• 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

JQuery content editable div and text box on submit not sending POST

How to get multiple values with same key from an array PHP

Laravel/docker-compose/redis - Class 'Redis' not found

PHP array slice from position + attempt to return fixed number of items

Symfony Error: "An exception has been thrown during the rendering of a template"

IlluminateDatabaseQueryException could not find driver [duplicate]

How to Create WooCommerce Subscription Product via. REST API?

PHP sort array of objects by two properties

how to pass row id in href of a tag in codeigniter controller?

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

php - add comma thousands separator but remove trailing zeros

How update php.ini on a Mac OS X Mojave?

Symfony/Form add attribute based on the data

PHP password_verify

Insert multidimensional array to codeigniter cart

About Contact Privacy policy Terms and conditions