php script to pick up files in a fold
-
Hello, I am using a slide show swf to show pictures in a fold for my wordpress blog. I don’t know about php script. I am using the following to pick every file with an extension .jpg. I want to modify it to pick up everyfile with an extension either .jpg or gif. and also there is a word thumb_ in file name. In this case not all files in the fold will be displayed. How can I do that? your instruction will be greatly appreciated.
// reading the directory and inserting the mp3 files in the playlist array
$n = 0;
$playlist = array();
$fdir = opendir($dir);
while($i = readdir($fdir)) {
// if a .jpg string is found, add the file to the array
if (strpos(strtolower($i),”.jpg”) !== false) {
$playlist[$n] = $i;
$n++;
}
}
// close the directory and sort the array
closedir($fdir);
array_multisort($playlist);
- The topic ‘php script to pick up files in a fold’ is closed to new replies.