PHP厘米到英尺[重复]

This question already has an answer here:

I'm busy figuring out how to convert centimeters to feet with a php script. I couldn't find anything on the internet so I hope you guys can help. I get the centimeters out of my database like this '182' How can I automatically convert it into 5' 11" ?

Thanks, Julan ter Weele

</div>

From the following SO link (not tested by myself):

function getMeasurements($mm) {

    $inches = ceil($mm/25.4);
    $feet = floor(($inches/12));
    $measurement = $feet."'".($inches%12).'"';

    return $measurement;
}

Needs to convert to centimeters...

You write a formula. For the record, 1cm is 0.0328084 feet

182 * 0.0328084 = 5.9 feet .9 feet is 10.8

Put the two together and your answer is 5 feet 10.8 inches.