Jump to content

readdir nuisance


Clinger

Recommended Posts

I've never seen this until just recently. When I read a directory using readdir, in addition to the usual ".." and ".", it is now returning a string that says "No Files Currently".

 

2 Questions.

1.) Why the **** would PHP return a string like that? If the directory is empty, it shouldn't return anything.

2.) How do I disable that?

 

Example:

<?php
$handle=opendir("blah/");
while (false !== ($file=readdir($handle)) {
if (($file != "..")&&($file != ".")) {
  echo "blah";
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/38808-readdir-nuisance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.