/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* In: $nacimiento = DD-MM-YYYY return: edad */ function getEdad( $nacimiento ){ $anio_nac = soloNum($anio_nac); $mes_nac = soloNum($mes_nac); $dia_nac = soloNum($dia_nac); if( $mes_nac > $mes ){ $return = $anio - $anio_nac - 1; }else{ if( $mes == $mes_nac && $dia_nac > $dia ){ $return = $anio - $anio_nac - 1; }else{ $return= $anio - $anio_nac; } } return $return; }
Comments
