Friday, 6 September 2013

PHP - Array and Div?

PHP - Array and Div?

How can I make this .$I. make the div id depending on its value? When I
check the source, the div id is always "ImgDiv- 0", how can I make it
1,2,3 ? This code generates 3 divs by the way. This is only part of the
code. The printf is at the end, I just need this chunk edited. If you need
the rest of the code, ill be happy to post it
<?php
for ($i=0; $i++) {
define('RANDOM_IMAGES_COUNT2',3);
define('RANDOM_IMAGES_FORMAT2', '<div id="imgDiv-' .$i.
'"style="width:170px;height:auto;float:left;text-align:center;top"><img
src="%s"
style="border-style:solid;border-width:2px;border-color:black;"/><a
href="%s" alt="%s" title2="%s">%s</a></div>');
}
?>

No comments:

Post a Comment