• 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

Laravel 5 controller sending JSON integer as string

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Laravel views are showing from cache on one server but works fine on other server

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Why is this PHP array not the same?

How to run a shell as root from php (apache)

Edit XML in HTML form and submit to self

Laravel - How to properly generate unique slugs from article titles?

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

PHP-Sort array based on another array?

Set quantity minimum, maximum and step at product level in Woocommerce

PHP Imap , php 7.4.3 on mac osx catalina

Yii2: How do I debug console commands?

OctoberCMS / Anonymous Global Scope

PHP password_verify

About Contact Privacy policy Terms and conditions