• 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 insert data from multiple select dropdown values into database?

Natural ORDER in Laravel Eloquent ORM

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

Display a product custom field only in WooCommerce Admin single orders

Update Total in checkout of Woocommerce with Ajax Request

Laravel 5 session not persisting after user is logged in

PHP's array_map including keys

Implode array with array of glue strings

SilverStripe unable to populate multiple member Childs

Two buttons one form

Form repeater send wrong data with last element in Laravel

How to give apache permission to write to home directory?

Symfony process run throws exception - executing on command line works

Why i get wrong output for html markdown?

Check if a string contain multiple specific words

About Contact Privacy policy Terms and conditions