0

I just want to know how to convert inch based on the integer inputted in the field.

For Example:

$int = $_POST['int']; //value 1

//computation here...

$inch = //formula

//echoing the inch
echo $inch;
Kevin
  • 41,694
  • 12
  • 53
  • 70
Valiancer
  • 29
  • 3

1 Answers1

0

If you want convert from centimeter can you use this source

function cm2inches($cm)
{
     $inches = $cm/2.54;
     $inches = $inches%12;
     return sprintf('%d ins', $inches);
}
echo cm2inches(162);

You will have result

3 ins
Quynh Nguyen
  • 2,959
  • 2
  • 13
  • 27