Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2003
    Location
    London, UK
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems with using a loop

    Hey, I posted earlier, but I didn't get a very good response so I tried to have a go to improve my scripting but I've hit another problem:

    <?php
    $product=array(
    array("Osiris","£60","An awesome shoe","osiris.jpg"),
    array("Etnies","£70","An awesome durable shoe","etnies.jpg")
    );


    print ("<table cellspacing=0 cellpadding=0 border=0><tr><td rowspan=3><img src=".$product[0][3]." width=150 height=100></td><td><b>".$product[0][0]." </b></td></tr><tr><td>".$product[0][2]."</td></tr><tr><td>".$product[0][1]."</td></tr></table><p>");


    ?>

    Thats what I've got so far. What I need to be able to do is repeat the 'print' for the same amount of sub-arrays (so 2 times in the example), and for every time it repeats, the number in the first [ ] increases by one. example:

    so first time it would be $product[0][3]
    second time it would be $product[1][3]


    I hope that makes good sense, I anticipate your replies
    Thanks guys

    Jay Vincent

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Please do not create multiple threads on the same topic. Your previous thread was created just today. Not everybody on the forums is on here at the same time as you as they are all in different time zones around the world.

    All replies can go in the previous thread...

    http://www.codingforums.com/showthre...threadid=32050

    Closing thread...
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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