• 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

Correctly determine if date string is a valid date in that format

Show only featured products in Woocommerce shop page

Yii2: How do I debug console commands?

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

How to modify CSS in a specific page of the WP admin dashboard (backend)

Laravel Excel::store file empty after stored

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

In PHP, which is faster: preg_split or explode?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

Magento 2 - How to add new block to admin panel in product page?

How to auto populate preferredCountries from intl-tel-input with db output

About Contact Privacy policy Terms and conditions