• 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 get the total hour from starting time to end time in php

Phalcon: setStatusCode returns empty response

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

How can I create a Download Page with post php method?

How to get total pages of PDF with FPDF?

Required field only if another field has a value, must be empty otherwise

Adding hreflang tags automatically in WordPress subdirectory multisite

PHP array, move keys and values to new array, but mix it up

Laravel insert dynamic input values with radio button

What is the function of the (new Date()).getTime() in PHP?

How to override htaccees file for cache control header

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Laravel Livewire: jQuery not working in child component loaded via @if statement

Laravel Passport - Not able to get token string in response?

About Contact Privacy policy Terms and conditions