Regex for checking folder name and file name
4 answers
It would be more efficient to use the strpbrk () function.
if (strpbrk($filename, "\\/?%*:|\"<>") === FALSE) { /* $filename is legal; doesn't contain illegal character. */ } else { /* $filename contains at least one illegal character. */ } +9