• 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

Using spatie/media-library, how to rename a collection of uploaded files?

Merge column values from two arrays to form an indexed array of associative arrays

Center point of multiple gps coordinates with php

Check If array is null or not in php

hidden INPUT value not available in $_POST

Limit of log line written to Apache Errorlog from mod php error_log

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

Add customer email and phone in "Order" column to admin orders list on Woocommerce

PHP: Telegram Bot: Insert line break to text message

how to upload binary image to sql server using php laravel

How to use PHPCBF to fix one issue at a time?

Minimum order amount except for specific shipping method in WooCommerce

Handle error for duplicate entries - PHP/MySQL

Connecting an HTML webpage to a SQL Server

About Contact Privacy policy Terms and conditions