• 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

Webscraping Symfony/Panther: Can't get HTML

Remove product downloads section in woocommerce email notifications

SQL to convert multiple rows into a single row of variable length

How to add automatically collapse/expand in content wordpress (single.php)?

PHP echo values of all sub keys [duplicate]

PDOException SQLSTATE[HY000] [2002] No such file or directory

How to convert binary string to normal string in php

PHP error: "The zip extension and unzip command are both missing, skipping."

Project structure for PHP

How to make autocomplete work in foreach php loop? (vscode, intellisense)

How to insert data from multiple select dropdown values into database?

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

How to add a custom field to all Woocommerce attribute terms using add_action

"cannot list resources" error from WooCommerce REST API

Store multiple fields in JSON column (Nova CMS)

About Contact Privacy policy Terms and conditions