Jump to content

scan directory acting werid


ohdang888

Recommended Posts

my code is below..

 

I am scanning a folder for all the files in it. There are probabaly close to 20 gif and jpg pictures in that folder, but only the picture "none.jpg" is coming up (which is a real picture, ) but why is only 1 file being shown?

 

Thanks!

<?php
$file = scandir("gamepic");

foreach($file as $key => $value) {

    if(is_file($value)) {
    $total++; // Counter
    echo "$value<br />\n";
    }

}

echo "<p>Total files: $total</p>";

?>

Link to comment
https://forums.phpfreaks.com/topic/98088-scan-directory-acting-werid/
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.