title: How to calculate time difference in PHP and store the time difference in mysql database
body: <p>I have a table in the database with the name <code>attendance</code>. It has three columns: <code>intime</code>, <code>outtime</code> and <code>work_hours</code>.
  I have date and time in <code>intime</code> and <code>outime</code>. Now I want to write the php code to calculate the time difference in the format <code>hh:mm:ss</code> to store into the column <code>work_hour</code> of <code>attendance</code> table.</p>
  
  <p>Please help me out.</p>