• 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

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

dompdf and img tag, image wont show

php script to delete files older than 24 hrs, deletes all files

Debugging Stripe Webhook Event

correct PHP headers for pdf file download

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

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

Component install error: JInstaller: :Install: File does not exist

Laravel database insert with combining array and string

PHP usort() order in case of equality

Upgrade PHP on AWS Linux

woocommerce_wp_select options array from product attribute terms

Send same name multiple checkbox values via ajax

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Sliders in Laravel

About Contact Privacy policy Terms and conditions