te has dejado cerrar el parentesis del if en el segundo if
el codigo quedaria asi:
Código PHP:
<?
$cadena = "19801012";
$birth1 = substr($cadena, 0, 4);
$birth2 = substr($cadena, 4, 2);
$birth3 = substr($cadena, 6, 2);
if ($birth2 <= date("m")) {
if ($birth2 < date("m")) { echo date("Y") - $birth1; } else {
if ($birth3 < date("d")){ echo date("Y") - $birth1; } else { echo date("Y") - $birth1 - 1; }
}
} else { echo date("Y") - $birth1 - 1; }
?>