I know the day of birth, lets say: 1996-12-12
I know that today is: 2014-11-12
Now I want to get the date of the last birthday. And I have written this solution, but I don't like the complexity of the code. How can I write it more readable for other programmers?
$lstrBirthday = '1996-12-12';
$lstrLastBirtday = (strtotime(date('Y').date('-m-d', strtotime($lstrBirthday))) > strtotime('now')) ? (date('Y') - 1).date('-m-d', strtotime($lstrBirthday)) : date('Y').date('-m-d', strtotime($lstrBirthday));
Thanks!