• 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

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

How do I set the maximum php memory limit

Laravel after login Two factor not working

Cannot pass null argument when using type hinting

add_action() function in wordpress not working [duplicate]

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

Problem with fetching data from database in Laravel

Load a .env file with PHP

api response laravel doesn't show

array_key_exists(): The first argument should be either a string or an integer

Get number of working days between two dates in PHP [duplicate]

*** ERROR *** The PHP configuration loaded file is: c:/wamp64/bin/php/php8.1.0/php.ini - should be: c:/wamp64/bin/apache/apache2.4.53.1/bin/php.ini

Object of class stdClass could not be converted to string error

No definition found for function in vendor vscode

Yii2 select2 database exception number of bound variables does not match number of tokens

About Contact Privacy policy Terms and conditions