So I can parse XML with PHP easily.
The issue comes when I only want to parse the first 10 items, then close the div, then open another div, and parse the next 10. Any I making sense?
Imagine:
<div class="row">Parse ten items into ten new divs</div>
<div class="row">Parse items 11-20</div>
<div class="row">Parse items 21-30</div>
And so on.
Any ideas?
not quite
Using a counter and a simple for loop should do it.
:duh:
So, post the code you fucking idiot, and we’ll do it for you.
psuedo code
load xml crap into array
$counter = 0
echo <div>
foreach (array) {
$counter++
If counter = 10 {
echo </div> <div>
counter = 0
}
echo the rest of your crap
}
echo </div>
nah dawg nah. i’ll do it, how else to learn?