• 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 display validation error

Extract string between first whitespace and last whitespace in php

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

Lumen - Postgresql setup - Composer

file_put_content...fail to open stream:Permission denied in Laravel 5

Appending data to an anchor tag

Access relation of pivot table in Laravel

Use same method for inertia response and json response Laravel Jetstream

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

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

Update Order custom Field value with WooCommerce REST API

How to write PHP in XSLT

Assets not referencing to public folder (Laravel)

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

About Contact Privacy policy Terms and conditions