Just add in a couple of redundant `readdir` calls:
PHP Code:
$dir = opendir($path);
readdir($dir);
readdir($dir);
//... continue as normal
Hope that helps
Important Edit: What you've asked for is in the second example of the PHP manual:
http://uk3.php.net/readdir (RTFM)