• 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

Change user role if checkout custom checkbox is checked in WooCommerce

Add Class in html Dynamically in PHP

How to fix bootstrap multiselect search data using ajax

How to get page number on dompdf PDF when using "view"

Group rows by column and sum another column within groups [duplicate]

How to get an Array value inside an object in an array Php [duplicate]

Yii Ajax Submit button

Sum array values of a column within each column of an array with 3 levels

How to redirect to another page and call a Function there on Angular ng-click

Laravel 8 factory state afterCreating

How can I format this number correctly using PHP?

Jquery DataTables: Data not displaying in table via Ajax

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

How to render html from a @foreach loop in a textarea

Testing subscription renewals on Stripe

About Contact Privacy policy Terms and conditions