Possible Duplicate:
How to calculate the difference between two dates using PHP?
I have three input in html. two of them are start date and end date and the third one is to find the difference between them and display the result .
here is the inputs:
<p><span>Start date:</span> <input type="date" required min="2012-01-01" name="start_d" id="start_d" ><span>* Format: YYYY-MM-DD</span><br></p>
<p><span>End date:</span> <input type="date" required min="2012-01-01" name="end_d" id="end_d" ><span>* Format: YYYY-MM-DD</span><br></p>
<p><span>Duration :</span><input type="text" required name="duration" id=duration" readonly="readonly"><br></p>