• 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

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

How to average columns of data from multiple, flat arrays?

Access relation of pivot table in Laravel

Multiple order by in WooCommerce

Composer Warning: openssl extension is missing. How to enable in WAMP

generate an Excel file using PHP

Python - Include another Python script

WooCommerce: Add/display Product or Variation custom field everywhere

wordpress function breaks wp-admin

How to convert a carbon into string, to take the date only?

Check for PDO Results, If None Display Message, If Yes then Loop Through

php - add comma thousands separator but remove trailing zeros

Modify microseconds of a PHP DateTime object

Prestashop cUrl Login

laravel MVC execution flow

About Contact Privacy policy Terms and conditions