• 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

Search for array row with specific column value and return another value from qualifying row

Attempted to call an undefined method named "get" of class "MailController"

PHP DOTENV unable to load env vars

Webscraping Symfony/Panther: Can't get HTML

Message: Set sys_temp_dir in your php.ini after installed composer

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

Submitting a form with ajax in Wordpress

passwordless LDAP login and get user information using Kerberos ticket in PHP

how to fix Service provider class not found when using repository?

How to update array value in Laravel

Woocommerce redirect after add-to-cart error

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

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

Yii2 select2 database exception number of bound variables does not match number of tokens

About Contact Privacy policy Terms and conditions