How to create timeago function using php?

I had developed a date time stamp function using PHP. It is very important for social media web applications. I hope it’s useful for you.

Contains PHP code. You have to use the time_stamp() function to display the date and time.