• 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

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

VB.NET WebRequest with PHP POST

Insert multidimensional array to codeigniter cart

Target Laravelista is not instantiable

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

401 Unauthorized only occurring on some pages in Laravel 8

Detect a fetch request in PHP

How do I truncate a decimal in PHP?

GuzzleHttp Hangs When Using Localhost

Convert regular text to array using notepad++

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

json_encode turns array into an object

Add rows to Single product Additional information table in WooCommerce 3.6

Laravel: Why is my variable not being set while it's in the construct function of the controller?

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

About Contact Privacy policy Terms and conditions