if(!ereg("^[0-9]{4}$",$año)){echo "Ingrese un año válido.";}
<?if(strlen($año)!=4 || !ereg("^[0-9]+$",$año)){echo "Ingrese un año válido.";} ?>