PHP taking images from directories?

I’m building some sort of slideshow and I want to work with PHP to generate the slides doing this it’s not necessary to physically key in every path because slideshow is going to contain over 100 graphics.

What exactly I’m hoping to do is omit the repository phase and please have PHP pull many of the files from your directory we tell it too.after which it have this run your loop in order to insert your images into a list.So all You want to determine is the way to tell PHP for you to grab that.jpg files through the directory

I’m comparatively new for you to PHP so please try and be distinct.

Bless you!

I do a similar – that is a two step setup POST use – the very first is a article showing many of the different galleries I have (folders in the galleries folder)

<php
// open up directory in addition to make numerous all this folders in the gallery folder
$myDirectory = opendir(“images/gallery/”);

// find each entry
while (false! == ($file = readdir($myDirectory)))
in case ($file! = “.” && $file! = “..”)
$dirArray = $file;

// near directory
closedir($myDirectory);
variety ($dirArray);

// count things in array
$indexCount = count($dirArray);

//loop throughout the array associated with folders in addition to print these people all

for($index=0; $index < $indexCount; $index++)

$linktext = ($dirArray$index);
$pickImage = opendir(“images/gallery/”.$linktext);

// really look while in the folder in addition to pick an image to display – you can cut this specific out if you do not want a picture shown

while (false! == ($imageName = readdir($pickImage)))
in case ($imageName! = “.” && $imageName! = “..”)
$picArray = $imageName;

// near directory
closedir($pickImage);
variety ($picArray);

$useThisImage = ($picArray1);

echo “<div class =\"galleryBlock\\n";
$linktext = str_replace(“-“, ” “, $linktext);
echo $linktext;
echo “

\n”;

$picArray =””;

>

this is the second internet page it makes the gallery name in the link inside previous article – if all that’s necessary is one gallery so to show the many images as one solely, only that code along with set this variable $thisGallery while in the first line towards relative location of your file.

<php
$thisGallery = “images/gallery/”.$_GET’gallery’;
$myImageDirectory = opendir($thisGallery);

while($entryImageName = readdir($myImageDirectory))
in case ($entryImageName! = “.” && $entryImageName! = “..” )
$dirImageArray = $entryImageName;

closedir($myImageDirectory);
variety ($dirImageArray);

$indexImageCount = count($dirImageArray);

for($indexImage=0; $indexImage < $indexImageCount; $indexImage++)

echo “<img src=\"".$thisGallery."/".($dirImageArray

>

Would you like any even more help try to find us with tomate design and style in Mexico

Hi,
you can search some lisenced users sites including:

http://thefreelancesite.com

They generally have freelance developers with great programming along with coding practical experience.

Leave a Reply