Stripping out all illegal characters for a folder name

From: Date: Wed, 26 Nov 2003 15:31:54 +0000
Subject: Stripping out all illegal characters for a folder name
Groups: php.general 
Request: Send a blank email to php-general+get-171082@lists.php.net to get a copy of this message
Folks, I'm taking some user input, and creating a folder on the server. I'm already replacing " " with "_", and stripping out a few known illegal characters (', ", /, \, etc). I need to be sure that I'm stripping out every character that cannot be used for a folder name. What's the best way to do this? Do I have to manually come up with a comprehensive list of illegal characters, and then str_replace() them one by one? There's gotta be a better way to do this... Joseph

« previous php.general (#171082) next »