We found a code that we incorporated into our page. It displays the images, not exactly as we will have it when we are done but we know what we are doing with the way it will look–at least for now we think we do. However the code below will also display the filenames along with the images. Within the following code–how do we have the filenames not show? Thanks for the help so far. We are just trying to display images from a folder and not a directory which is why we went with the glob. Seems to work better.
.img{
width:75px;
height:75px;
}
#main{
width: 30px;
position: absolute;
left: 15%;
top: 100px;
}
–>
<?php
/* alpharead version 3: This function returns an array
containing the names of the files inside any given
folder, excluding files that start with a ‘.’, as well
as the filenames listed in the ‘$killit’ array. This
array is sorted using the ‘natural alphabetical’
sorting manner. If no input is given to the function,
it lists items in the script’s interpreted folder.
Version 3 fixes a MAJOR bug in version 2 which
corrupted certain arrays with greater than 5 keys and
one of the supposedly removed filenames.
written by Admiral at NuclearPixel.com */
function alpharead3($dir){
if(!$dir){$dir = ‘.’;}
foreach(glob("$dir/*") as $item){$sort[]=
end(explode(’/’,$item));}
$killit = array(‘index.html’, ‘index.php’,
‘thumbs.db’, ‘styles.css’);
$killcounter = 0;
foreach($sort as $sorteditem){
foreach($killit as $killcheck){
if(strtolower($sorteditem) == strtolower($killcheck))
{unset($sort[$killcounter]);}
}$killcounter++;}
if($sort){natsort($sort);}
foreach($sort as $item){$return[]= $item;}
if(!$return){return array();}
return $return;
}
//some basic usage
$folder = ‘images’;
foreach(alpharead3($folder) as $item)
{
echo ‘’.$item.“n”;
}
?>