• 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

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

Override default Auth routes in Laravel 7

how to fix Service provider class not found when using repository?

laravel MVC execution flow

What is PHP's equivalent of JavaScript's "array.every()"?

Return new collection without modifying original collection

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

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

Converting alphabet letter to alphabet position in PHP [duplicate]

Mobile browsers are adding .html to filename on download

Symfony there are no commands defined in the "make" namespace

Laravel Passport - Not able to get token string in response?

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Wordpress add responsive srcset header image to theme

About Contact Privacy policy Terms and conditions