user creates a new folder thru form:
$foldername = stripslashes ( $_POST['foldername'] );
//This erase white-spaces on the beginning and the end in each line of a
string:
$foldername = preg_replace('~ ^(\s*)(.*?)(\s* )$~m', "\\2", $foldername);
//erases all NON-alfanumerics
$foldername = ereg_replace("[^[:alnum:]+]","-",$folderna me);
this is working ok, but i cant figure out how to allow spaces between words
(ereg_replace("[^[:alnum:]+]","-", is inserting dashes)
thanks,
j
$foldername = stripslashes ( $_POST['foldername'] );
//This erase white-spaces on the beginning and the end in each line of a
string:
$foldername = preg_replace('~ ^(\s*)(.*?)(\s* )$~m', "\\2", $foldername);
//erases all NON-alfanumerics
$foldername = ereg_replace("[^[:alnum:]+]","-",$folderna me);
this is working ok, but i cant figure out how to allow spaces between words
(ereg_replace("[^[:alnum:]+]","-", is inserting dashes)
thanks,
j
Comment