• 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

Detect emoticons in string

PHP SoapClient: set a namespace without prefix

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

args[max_input] woocommerce if statement confused

Don't show recurring price for WooCommerce subscriptions worth 0$

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

How to submit the custom form data in database in WordPress without plugin using ajax?

Attempt to read property "view" on null when sending password reset email

Transpose multidimensional array and join values with commas

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

401 Unauthorized only occurring on some pages in Laravel 8

Two buttons one form

PhP how to calculate moments with variables rows

About Contact Privacy policy Terms and conditions