Check if directory path ends with DIRECTORY_SEPARATOR
In PHP I’m receiving a string from the user for a local file directory Path
I want to know if they’ve included the trailing slash (/) or not.
I would like this to be cross platform so I’d like to use the PHP constant
preg_match("/" . preg_quote(DIRECTORY_SEPARATOR) . "$/", $path);