Loop + counter
Posted: Thu Nov 11, 2010 6:31 pm
Hi all,
I'm trying to output the following HTML onto my page:
<li><a href=\"javascript:void(0)\" onclick=\"switch_product_img('photo_1', '$count');\"><img src='$row[photo1_thumb]' alt='' /></a></li>
This is currently part of a for loop and what I want to do is replace the numbers above e.g. photo_1 using the counter to inject the number e.g. photo_[counter]
However, I don't know the correct syntax to do that. Is someone able to let me know how I should be going about this?
Cheers,
vfm.
I'm trying to output the following HTML onto my page:
<li><a href=\"javascript:void(0)\" onclick=\"switch_product_img('photo_1', '$count');\"><img src='$row[photo1_thumb]' alt='' /></a></li>
This is currently part of a for loop and what I want to do is replace the numbers above e.g. photo_1 using the counter to inject the number e.g. photo_[counter]
However, I don't know the correct syntax to do that. Is someone able to let me know how I should be going about this?
Cheers,
vfm.