<?php
if ($handle = opendir('gallery3/var/thumbs/Captain-America/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";?><br/><?
echo rtrim($file, '.jpg');?><br/><?
$names[]=$file;
}
}
closedir($handle);
}
?>
I want to createa an array of the file names that are outputting and also the rtrim elements.
$fileto an array. What prevents you from doing the same with the return value ofrtrim($file, '.jpg')? Please be more specific about your question. Give an example of the array you want to get in the end.