Wow m@tt … this is fantastic information and it is really allowing me to experiment. I must remind you that i am an absolute novice at PHP, but basically i am building a little experiment and using what i learn to do so. It’s totally unconventional in my methods and extremely badly coded on my part, but it works and it really is just for fun at the moment.
If i am stretching this thread out too long, please say so, but i would like to expand on your previous and show you how i have implemented it. The following works in theory but there is maybe a better way of doing it.
I have used you previous example to display images from a database. The image URLs are all in the same column separated by a comma. The following example works, if 6 images exist, but obviously if only 5 exist it shows the description as produced by alt="".
What i would like to do is produce 1 image placeholder with php code and loop it for every image it finds instead of having 6 pre assigned place holders (incorrect terminology i know) so here is how it currently works.
[php]
<ul class="thumbs list-image clearfix">
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[0]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[0]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[1]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[1]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[2]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[2]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[3]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[3]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[4]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[4]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
<li>
<a class="thumb" name="leaf" href="<?php $parts = explode(',', $f1); echo $parts[5]; ?>" title="<?php echo $f2; ?>">
<img src="<?php $parts = explode(',', $f1); echo $parts[5]; ?>" alt="<?php echo $f2; ?>" style="width:146px; height:88px;"/>
</a>
</li>
</ul><!--/ .thumbs-->
</div><!--/ #thumbs-->[/php]
Could you advise of a tidier way of producing a similar result, but only show 2 if 2 exist or 10 if 10 exist ?
Thanks again for all your help !!