• 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

Laravel dosen't connect with Oracle

PHPS source file - 403 Forbidden You don't have permission to access this resource

How to make dot match newline characters using regular expressions

WooCommerce: Add/display Product or Variation custom field everywhere

Get latest Tweets - What API

PHP: How to quickly split a key=value file into associative array

Symfony Error: "An exception has been thrown during the rendering of a template"

Add record for each array elements if missing in table

Laravel Passport - Not able to get token string in response?

cakephp save drag and drop list order to database

Backend cannot be reached after Typo3 login screen

Reorder attribute dropdown terms in Woocommerce single variable products

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Unable to run composer install

Vimeo API: how to save a vimeo into a subfolder?

About Contact Privacy policy Terms and conditions