I have a lot of code but basically its a foreach loop with values collected and $i is the dynamic number.
I want to get a bunch of attachments from a json and have following inside the foreach
<?php
$i=0;
foreach($attribs->contentblocks->add_to_content as $count) {
if($attribs->contentblocks->add_to_content[$i]=='3') {
// other code goes here
?>
<?php for($a = 1; $a < 30; ++$a){ ?>
<?php echo $attribs->contentblocks->blockfile[$a][$i];?>
<?php } ?>
<?php $i++; }} ?>
But... it wont work. If i replace [$a] with an actual number like 1 or 2 or 3 it works.
How do i add the dynamic $a number into that line to work with my $i as well?
Cheers John
$aas incremented number or$i