• 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

Target class controller does not exist - Laravel 8

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

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

Smarty if isset

What is PHP's equivalent of JavaScript's "array.every()"?

phpseclib 2.0 can not use Composer to create autoload

PHP Array split string and Integers

Converting array to string and then back in PHP

Adding multiple items to WooCommerce cart at once

Magento 2 - Controller returning blank page

PHP - CURL using HTTPS [closed]

Get image type from base64 encoded src string

Create a new line whenever an array value reaches more than 10 characters

Execute only one time and then wait set period of time before executing again

how to retrieve the first and last instance of a row in pdo dataset

About Contact Privacy policy Terms and conditions