• 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

Magento 2 - Controller returning blank page

What is the function of the (new Date()).getTime() in PHP?

How do I pass the dynamic output of a php variable or php function to a CSS variable?

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Install mysql client in docker image

Add custom text under order details on WooCommerce My account view order pages

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

ORA-12546: TNS:permission denied error connection to remote oracle server

Laravel multi auth - Authentication user provider [] is not defined

Display specific shipping method if woocommerce product has specific acf field value

Additional price based on cart item count in WooCommerce

Why does using salted hash on python and php give me different results?

Shopify password update using Shopify API

get folder directory from input type file - PHP

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

About Contact Privacy policy Terms and conditions