I'm allowing administrators to create photo albums, each of which will have its own directory. The photo album name will be the directory, only modified to make it a standard web directory. I am changing all white spaces to _, all ' and/or " to nothing and making all letters lowercase. Using regular expressions I do this in three lines
But I get some really weird results for the directory name sometimes.....anybody haveCode:$dirname =~ tr/[A-Z]/[a-z]/; $dirname =~ tr/'|"//; $dirname =~ tr/\s+/_/;
a) ideas as to whats wrong or
b) a better way?


Reply With Quote
Bookmarks