:-): Geburtsdatum Gültigkeitsüberprüfung

Beitrag lesen

Hallo.

Beim Registrieren für mein kleines Projekt muss ich das Geburtsdatum überprüfen (wegen USK). Das mach ich mit folgendem Code:

  
function gebdat_valid($gebdat){  
 //Datum aufteilen  
 $gebdat_array=explode("-",$gebdat);  
  
 $alph=array("A","a","B","b","C","c","D","d","E","e","F","f","G","g","H","h","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","Q","q","R","r","S","s","T","t","U","u","V","v","W","w","X","x","Y","y","Z","z","Ä","ä","Ö","ö","Ü","ü","ß");  
  
 //Vorkommen prüfen  
 for($x=0;$x<count($alph);$x++){  
  if(in_array($alph[$x],$gebdat_array)) die("Verbotenes Zeichen im Geburtsdatum");  
 }  
  
  
}  

Doch der Code greift nicht, egal was für Zeichen ich der Funktion übergebe.

Könnt ihr mir helfen, die Funktion richtig zu schreiben?

Danke euch
:-)