• 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

jQuery Ajax Post with data

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

*** 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

How to upload mpdf file after generating to s3 bucket in php

Get WooCommerce products from specific category

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How do I upload a laravel project on cPanel shared hosting?

Why i get wrong output for html markdown?

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

XSS attack still works despite htmlspecialchars() doing its work

PHP block shortcut in Visual Studio Code

MySQL upgrade causing unexpected results on simple WHERE clauses

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

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

PHP Fatal error: Class not found - PHPUnit

About Contact Privacy policy Terms and conditions