• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to convert the int value to inch in PHP [closed]

php


PHP Snippet 1:

function cm2inches($cm)
{
     $inches = $cm/2.54;
     $inches = $inches%12;
     return sprintf('%d ins', $inches);
}
echo cm2inches(162);

PHP Snippet 2:

3 ins

Related Snippets

wordpress function breaks wp-admin

Not able to override collapsible.js in magento 2

PHP mail function is sending blank message body

The sum of the user's points

PHP Include for HTML?

Don't show recurring price for WooCommerce subscriptions worth 0$

how to prevent float variables displaying as scientific notation when printing [duplicate]

Add and update products to session cart in Laravel

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

Symfony autowiring issues since docker update

Yii2: How to download backup files using spanjeta/yii2-backup?

unable to load your default controller on Codeigniter

PHP 8.1: strftime() is deprecated

Symfony 4: "Autowire: you should configure its value explicitly."

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

About Contact Privacy policy Terms and conditions