strip special chars for linux

Discussion in 'PHP' started by beermaker74, Feb 18, 2007.

  1. #1
    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
     
    beermaker74, Feb 18, 2007 IP
  2. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #2
    picouli, Feb 19, 2007 IP
  3. beermaker74

    beermaker74 Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    preg replace is sweet. It worked perfectly. Just goes to show that I need to learn more about expressions
    thanks
     
    beermaker74, Feb 19, 2007 IP