Dynamic Generation of Tags from an Array
<HTML>
<HEAD><TITLE>Using the array as a list</TITLE></HEAD>
<BODY>
<?php
$images = array('image1.jpg', 'image2.jpg', 'image3.jpg');
foreach($images as $val): ?>
<IMG SRC="/images/<?php echo $val; ?>">
<?php endforeach;?>
</BODY>
</HTML>
Related examples in the same category