Dateiname:


<!DOCTYPE html><html><head>
<meta charset="iso-8859-1">
<title>NameCheck</title>
</head>
<body>

<?php
if (isset ($_POST["dateiname"])) {
  $name= strtolower($_POST["dateiname"]);
  $sname=sauber($name);
  echo "<h1>$sname</h1>";
}

function sauber( $dname ) {
  $nein = array('Ä','Ö','Ü','ä','ö','ü','ß');
  $ja = array('ae','oe','ue','ae','oe','ue','ss');
  $dname = str_replace( $nein, $ja, $dname );
  $patt = '/[^a-z0-9.-]/';
  $repl = "_" ;
  return preg_replace( $patt, $repl, $dname );
}
?>

<form method="POST" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
	<p>Dateiname: <input type="text" name="dateiname"></p>
	<p><input type="submit" value=" Senden "></p>
</form>

</body>
</html>