i am allowing file uploads and have it set up to take spaces out of the name but there are certain characters that throw linux and xml out of wack. the & being one of them. I wantto strip any characters that are going to cause an issue. Is there a function to do this? I know there is preg replace and str replace but doesnt that entail listing every character that might be an issue. If that is the case and what I am going to have to do then where do i get a complete list of special chars that linux doesnt like? the file names arent important to me. as they are all referenced in a database. if the function is toomuch hassel I guess I could just rename all the files. Well im open to ideas thanks
1) htmlspecialchars [ http://php.net/htmlspecialchars ] 2) * better approach: allow only what you want *: preg_replace("/[^a-zA-Z]/", '', $string) (for example to allow only letters) [ http://php.net/preg_replace ] HTH, cheers!
preg replace is sweet. It worked perfectly. Just goes to show that I need to learn more about expressions thanks