• 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

How to submit a form when page loads using JavaScript?

virtctl works when executed via command line but not from php exec()

Unit (real unit test) of test laravel relationship

Toggle between a textbox and a select using PHP

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Clients authentication and user authentication with laravel

WAMP Virtual Host not working

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

Override default Auth routes in Laravel 7

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

How to skip cart page on woocomerce for certain products only?

Filter WooCommerce products with post__in and additional meta queries

How to install php yaml on CentOs?

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Clear javascript source cache laravel 5.8

About Contact Privacy policy Terms and conditions