View Single Post
Join Date: Mar 2008
Posts: 100
Reputation: petr.pavel is an unknown quantity at this point 
Solved Threads: 14
petr.pavel's Avatar
petr.pavel petr.pavel is offline Offline
Junior Poster

Re: PHP file reading error

 
0
  #2
Mar 13th, 2008
Hi John,
I'm reluctant to believe you on the spaces issue with readdir(). I checked the manual and nobody in the discussion has ever mentioned it. Maybe you think that it skips the files but in fact, something else down the road in your script does.

Anyways, try using glob() instead. It will make your script look prettier :-)
Something along these lines:
  1. $pattern = "$dir/*.txt";
  2. $files = glob($pattern);
  3. var_dump($files);
  4. ...
Petr 'PePa' Pavel

The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Reply With Quote