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
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: