date - How to calculate year from entering my age using php -


How can I calculate the year to enter my age using php?

Example:

I'm entering my age as 24.

So I need to get the year as 1985.

How can this be done?

Thank you, if you know simple math, then you know that 2010 - 24 - 1 = P>

or $ year = date ("y") - $ theirage - 1 ... but only By giving an age, it shows which year they are born. For example:

If date is 30 December 2010 and they say that they are 24, you are still saying that they were born in 1985 when the possibilities are very much, Too many high that they were actually born in 1986. You can not trust your age on your birth year.

Edit If this was not very clear:

Today's date is June 16, 2010. So be 24 years old, I have to live somewhere between June 17, 1985 and June 16, 1986. It is about half of the birth centenary which will be in 1985 and about half of 1986, which leads to a lot of inaccuracy.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -