• 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

Toggle between a textbox and a select using PHP

wordpress : How to specify the cause "This site can’t be reached"

Sliders in Laravel

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Composer Script echo

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Can we define variables in `.tpl` files?

Increase value by 1 on button click

Set quantity minimum, maximum and step at product level in Woocommerce

Laravel Displaying image from database

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

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

array_key_exists(): The first argument should be either a string or an integer

PHPExcel How to set conditional formatting to change cell background color based on cells values

About Contact Privacy policy Terms and conditions