In one the my project we need to calculate user age from data of the birth.
It is very easy to calculation age fro data of birth. For more details check out the following snippet:
# object oriented
$from = new DateTime('1992-01-04');
$to = new DateTime('today');
echo date_diff(date_create('1992-01-04'), date_create('today'))->y;
Thanks for reading and let me know need any changes.