Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/10/2012, 09:09
Avatar de veruti85
veruti85
 
Fecha de Ingreso: octubre-2012
Ubicación: Entre Huelva y Madrid
Mensajes: 32
Antigüedad: 12 años, 3 meses
Puntos: 7
Respuesta: Comprobar facha de nacimiento con anos

Prueba con:

$fechanac = mktime(0,0,0,$_POST['mes'],$_POST['dia'],$_POST['anio']); //Construyes la fecha en segundos

$edad = time()-$fechanac; //AQUI SACAS LOS SEGUNDOS TRANSCURRIDOS DESDE QUE NACIO HASTA LA HORA ACTUAL

$anios = floor($edad/(60*60*24*365.25);) //LO DIVIDES POR LOS (3600*24*365.25) SEGUNDOS DE UN AÑO y truncas el valor

Espero que te sirva. No lo he probado, pero basicamente debe ser asi

Saludos