Reputation: 3
I am using wamp in win7, and I try to read c:\wamp\tmp by glob with php, but the result is an empty array
print_r(glob("C:\wamp\tmp\*"));
I can see any folder in c:\wamp
except c:\wamp\tmp
, and I make sure that folders has the same setting about read write...
Upvotes: 0
Views: 222
Reputation: 782529
\t
is an escape sequence that means the Tab character. You have several ways to deal with it:
Escape it with another backslash.
print_r(glob("C:\wamp\\tmp\*"));
Use single quotes instead of double quotes, since escape sequences aren't processed in single quotes.
print_r(glob('C:\wamp\tmp\*'));
Use forward slashes instead of backslashes, since Windows allows either as a directory separator.
print_r(glob("C:/wamp/tmp/*"));
Upvotes: 2