• 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

PHP: set a (deep) array key from an array [closed]

Laravel relationship belongsToMany with composite primary keys

Twig - How to check if variable is a number / integer

How to run or debug php on Visual Studio Code (VSCode)

Populate Dynamic Dropdowns List in Codeigniter

ldap is missing from system when installing adldap2 in laravel

Laravel 5.2: Unable to locate factory with name [default]

How can I access an array/object?

I cannot create a auto generated date time in mysql workbench

phpunit - testing is painfully slow

get folder directory from input type file - PHP

WooCommerce Additional Information - if empty, hide

Check if my GET request has Header: Token

Handle error for duplicate entries - PHP/MySQL

how to validate form data in codeigniter 4

About Contact Privacy policy Terms and conditions