• 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

How to set a domain name with php artisan serve

Why does array_map() with null as callback create an "array of arrays"?

PHPExcel_IOFactory::createWriter causes wrong behaviour

How to validate Envato Purchase Code in PHP

Adding reCAPTCHA v2 into my PHP file

How to use PHPCBF to fix one issue at a time?

Laravel set default language not working

Can't exclude directories from .htaccess mobile redirect?

how to check version of codeigniter framework?

Problem with fetching data from database in Laravel

How to MODIFY a Google Docs document via API using search-and-replace?

How do I remove this delivery notification from here?

How to retrieve Active Directory group policy maximum password age using LDAP

Move a child array to parent array and change parent/child name

could not find driver Debian SQL Server PHP

About Contact Privacy policy Terms and conditions