php image array
Results 1 to 4 of 4

Thread: php image array

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    9

    php image array

    I'm trying to display all the images inside a certain directory. Here's what I have so far...

    Code:
     <?php
    
    $dir1 = "001/"; $images1 = scandir($dir1);
    
    $i1 = sizeof($images1); 
    
    foreach ($images1 as $value)
    
    { echo "<img src='001/" . $images1[$i1]; . "' alt='' />" }
    
    ?>

  2. #2
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Contact Unit "Coping Mechanism"
    Posts
    22,116
    And what's the problem you're having (it's probably related to the fact that the ; in the last line is in the wrong place).
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    9
    I moved the ; but it still didn't work. Nothing is being displayed though there are 3 pictures in the 001 directory. the code is in pics.php which is directly above the 001 directory.

  4. #4
    Junior Member
    Join Date
    May 2013
    Posts
    9
    Can't seem to b able to edit my post... anyway, it's working now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •