I want to store a user's date of birth, publish it and show the age. I know how to store the date of birth, but I do not know how I could echo the age afterwards.
I want it like:
username - 06/02/1992 (22 years)
How do I do this?
I want to store a user's date of birth, publish it and show the age. I know how to store the date of birth, but I do not know how I could echo the age afterwards.
I want it like:
username - 06/02/1992 (22 years)
How do I do this?
Essentially you just need to use the date() function to format it.
This answer will help if you're using MySQL and will also describe the basics of formatting dates. Convert from MySQL datetime to another format with PHP