<td valign="bottom">
<div style="width: 205px;height: 21px;border: 1px solid;">
<div style="height: 21px;background-color:#5f5f5f; width:<?=$width?>"></div>
</div><br>
<span style="font-size:11px;">*Valid for 1 year from the date of purchase</span>
</td>
This is a PHP code to show an expiration bar. It is going to show how many months are left in the user account. I have a database from which I can extract the date when the user joined. Suppose the user joined on 2014-1-21
, then after one month the width should be 10%. How can I get the difference between the two dates in days so that I can check and decide what should the width of the bar be.