php - Subtract one DateTime from another and return days -


i have 2 datetime objects. 1 represents 2 days , other represents 2 days , 6 months now.

i need able count number of days between these 2 dates display users dates can book on.

i have calculated 2 dates struggling finding way subtract them , return difference in days.

$first; // first datetime object  $second; // second datetime object   $diff = $first->diff($second);  echo $diff->days; 

also take @ dateinterval class @ php.net


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -