I need a function, native or user made, that checks if a string is a valid directory name.
I’ve had a look through the PHP documentation and I can only find the function is_dir which checks if it’s an existing directory or not and not a valid name for a directory.
I need a function, native or user made, that checks if a string is
Share
This should work for you.
See regex for validating folder name & file name