title: Convert centimeters (cm) into feets and inches using PHP
body: <p>I am trying to convert centimeters into feets and inches using PHP. </p>
  
  <p>This is function I use for this calculation. </p>
  
  <pre><code>function getMeasurements($cm) {
  
      $inches = ceil($cm/2.54);
      $feet = floor(($inches/12));
      $measurement = $feet."' ".($inches%12).'"';
  
      return $measurement;
  }
  </code></pre>
  
  <p>I am calling this function like this : </p>
  
  <pre><code>$cm = 185;
  echo "My Height = ".getMeasurements($cm);
  </code></pre>
  
  <p>Problem is after calling this I can get a result like this- </p>
  
  <blockquote>
    <p>My Height = 6' 73"</p>
  </blockquote>
  
  <p>look at inches. Its incorrect. can anybody tell me whats the reason to get such a result. </p>
  
  <p>Thank you. </p>