• 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

JQuery content editable div and text box on submit not sending POST

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

selected value from the listbox in php

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

Google Gmail API - How to login programatically?

how to validate form data in codeigniter 4

Hi, I am making a contact form thingy, and my php isn't working any reason why?

Prevent blank space in pdf pages (DomPdf)

If action is on a different page do I use fwrite function

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

sqlsrv_num_rows() expects parameter 1 to be resource, boolean given

How to change product Image when variables are selected in Shop and Archive Pages?

Display Link Title Instead of URL in XSL

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

PHPSpreadsheet - How Do I Use Auto Migration Tool

About Contact Privacy policy Terms and conditions