How to get the interval between two timestamps in PHP?

samurai

New member
There are two timestamps.

echo $time1;//The result is "2009-05-02 22:09:28"
echo $time2;//The result is "2009-05-04 20:07:19“;
How can I get the interval between $time1 and $time2?
When I set
$time3=$time2-$time1;
I get 0.
Please advise.
 
Back
Top