I have searched for this but did not find a perfect function in php. I want to get a php function that calculate person age only in months.
For example:
less then one month old.
5 months old.
340 months old.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using PHP’s
DateInterval(available from 5.3.0), that’s pretty easy:Now
$monthswill contain the number of months I’ve lived.