• 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 sort by a custom appended relation to model

How to write PHP in XSLT

PHP function Not Working As Expected From functions.php Include File

Reducing authentication calls on external API (Laravel 5.6)

how to check version of codeigniter framework?

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

Laravel 5 controller sending JSON integer as string

Fatal error: [] operator not supported for strings

How to auto populate preferredCountries from intl-tel-input with db output

Spam Filter in Contact Form

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Manage independently the decimal number of the price of each product [duplicate]

Google Calendar API batch request PHP

Applying programmatically a coupon to an Order in WooCommerce3

About Contact Privacy policy Terms and conditions