• 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 'post_type_link' hides permalink

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

MySQL order by field in Eloquent

How to run a shell as root from php (apache)

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

Star and Half Star Rating in Laravel

PHPSpreadsheet - How Do I Use Auto Migration Tool

How to get monthly wise data in laravel

Laravel whole batch is cancelled if one Job fails

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

With doctrine ODM, can I embed many subdocuments in a main document?

Can I write PHP code across multiple lines per statement?

Unable to get password for the instance created from AMI

How do I do HTTP basic authentication using Guzzle?

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

About Contact Privacy policy Terms and conditions