I have issue while using glob function when path directory with square brackets.
// Example 1 - working $path = 'temp'. DIRECTORY_SEPARATOR .'dir - name'; $files = glob($path . DIRECTORY_SEPARATOR . '*.txt'); // List all files echo '<pre>'; print_r($files); echo '</pre>'; Above code is working but when directory name with square brackets like dir[name] or dir - [name] then its not working.
// Example 2 - not working $path = 'temp'. DIRECTORY_SEPARATOR .'dir - [name]'; $files = glob($path . DIRECTORY_SEPARATOR . '*.txt'); // result got empty if file on that directory echo '<pre>'; print_r($files); echo '</pre>';