ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Working with Files in PHP, Part 3
Subject:   While loop args are incorrect
Date:   2005-01-20 07:45:04
From:   stevelux
couldn't get it to work so I consulted the PHP man.


Where you have:


while ($file = $mydir->read()) !== false)


should be:


while (false !== ($file = readdir($mydir)))


That's what made it work for me. Please note that that I used:


readdir()


instead of:


read()