This is an archived thread from the StopByte developer forum —
browse all archived threads.
StopByte is now a payments & ecommerce toolkit — check out our
free calculators.
Hello, I have a function that I am using in PHP for when a new blog rating is posted and it will show this output
2 minute(s) ago , sdfsdsf says:
with some stars to make it look good. But when I post a new blog rating it always just starts off at 2minutes ago and doesn’t say 1 second ago or anything like that, the rest of it is good, it is just off by 2 minutes, Here is the function
Can anyone tell me what I am doing wrong to make it always start off at 2minutes ago?
2 Likes
Yassine
(Yassine)
#2
I personally couldn’t understand the whole function you got above, why having that $length array in the first place! But nevertheless here is a working function that takes a string date as input, alongside a $fullboolean variable, if $full is false, the function will return the short representation of each date part: