• 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

Call authenticate manually in router middleware

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Cannot connect to own websocket server when on secured domain

Unable to guess the mime type as no guessers are available Laravel 5.2

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Limit WooCommerce products in cart only from one custom taxonomy

PHP array stringify

Upload a file Using PHP and JavaScript

Using Associative arrays

Malformed MIME header error in Symfony 5.3

Laravel: HTML in notification

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

How to give apache permission to write to home directory?

WordPress Subquery returns more than 1 row on SELECT

SlimExceptionHttpNotFoundException

About Contact Privacy policy Terms and conditions