الثلاثاء، 24 ديسمبر 2013

PHP Code seems to not work [closed]

It is not working because you are using $interval->a for days and $interval->S for seconds. Correct is $interval->days (for if ($interval->days <= 7)), $interval->d (for if($interval->d !== 0)) and $interval->s (for if($interval->s !== 0)).

See DateInterval for correct parameters.

You can use this code:

echo time_elapsed_string('2013-09-01 00:22:35');echo time_elapsed_string('2013-09-01 00:22:35', true);17 days ago17 days, 1 hour, 40 minutes, 12 seconds ago

Link to the function.


View the original article here

ليست هناك تعليقات:

إرسال تعليق