title: Time difference in php (h:m:s) format
body: <p>I am insert a two time in database and how to find the difference to two times the result is show like h:s:m format  i will try to find the difference of this time </p>
  
  <pre><code>$from_time = $worker-&gt;timefm; //08:30:00  
  $to_time= $worker-&gt;timeto;  //17:00:00
  $diff=$to_time-$from_time;
  echo $diff; //9
  </code></pre>
  
  <p>The answer show 9 only ,the correct answer is 8:30 why this show only 9 how the answer show in time format how to solve this issue ? help me!! thanks in advance</p>
  
  <p>i will try this codes </p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-php">How to get time difference in minutes in PHP</a></p>
  </blockquote>
  
  <p>but not work</p>