Created
May 15, 2015 13:37
-
-
Save ratulcse10/11eaba687bdd4de843de to your computer and use it in GitHub Desktop.
difference between two date in year in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$d1 = new DateTime(); | |
$d2 = new DateTime(date('Y-m-d', strtotime($student->dob))); | |
$diff = $d2->diff($d1); | |
echo $diff->y; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment