Created
October 4, 2012 16:03
-
-
Save loraxx753/3834613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Lets say the itema are stored in the $items variable | |
//$items[0]['Product Image'] is "product1.jpg" (that's what you would put in the database/the picture of the first item) | |
//Then you'd do | |
foreach($items as $item) | |
{ ?> | |
<h2><?=$item['Product Name']?></h2> | |
<img src="img/<?php echo $item['Product Image'];?>.jpg" /> | |
<p><?=$item['Description']?></p> | |
<?php } //This ends the foreach loop | |
//Which would look like <img src="img/product1.jpg" /><img src="img/product2.jpg" /><img src="img/product3.jpg" /> in the browser. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment