The idea is that there will be a php function that echo’s html for every image in a directory(scandir)
I figure using a for each(something like) to walk through that array and assigns the values to img src values
but in order for there to be a function that assigns class values that would allow for
scripted rather than manual css positioning I need to be able to assign classes based on
relative position in a grouping of objects. for instance, there are 50 images in a directory the scandir returns an array of those files a function generates img tags for each item assigns class (a function in a variable to accomplish this, i suspect) by cycling through 5 classes with the output being like
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
<img class="a" src="example">
<img class="b" src="example">
<img class="c" src="example">
<img class="d" src="example">
<img class="e" src="example">
now the numbers 50 & 5 are hypothetical, I will more likely using class assignment cycles of 7 or 12
really please how do I do this? I’m just learning on my own and it’s really important.
1 Answer