Jump to content

[SOLVED] Tell me how man...


JacobMarshall

Recommended Posts

A modified this...

 


<?php

if ($handle = opendir('/path/to/files')) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";

    /* This is the correct way to loop over the directory. */
    for($i=0;(false !== ($file = readdir($handle)));$i++) {
        
         }
     
    $filecount=$i;

    closedir($handle);
}
?>

 

 

use the php.net / google!

 

http://us2.php.net/manual/en/function.readdir.php

try:

 



<?php



if ($handle = opendir('/path/to/files')) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";

$a=0;
  
    while (false !== ($file = readdir($handle))) {
       $a++;
    }

    closedir($handle);


echo "$a files";

}
?>


 

make sure the dir path is correct

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.