rgb192
asked on
iterate through all the elements in an array instead of print_r
<?php
$filesarray = array();
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_file($entry)) {
//echo "$entry<br />";
$filesarray[] = $entry;
}
}
closedir($handle);
}
print_r($filesarray);
?>
this question is just for the last line:
there are elements in
print_r($filesarray);
and I want to do a foreach or while loop to iterate through all the elements and echo each element
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
$key=>value works
thank you
thank you
http://stackoverflow.com/q