- function age($date){
- $year_diff = '';
- $time = strtotime($date);
- if(FALSE === $time){
- return '';
- }
- $date = date('Y-m-d', $time);
- list($year,$month,$day) = explode("-",$date);
- $year_diff = date("Y")
- //该片段来自于http://www.codesnippet.cn/detail/090120131448.html
来源: http://www.codesnippet.cn/detail/090120131448.html