3 posts by 2 authors in: Forums > CMS Builder Community
Last Post: October 14, 2014   (RSS)

Ok, I have made some progress, but still no cigar, the code almost works, 
the for loop finds the first match fantastically, but doesnt find the rest of the matches in the foreach

Any ideas ? 

<?php foreach ($corporatesRecords as $record): ?>
<h3><?php echo htmlencode($record['title']) ?></h3>
<?php $list = join(',', $record['project_team:labels']);
$array = explode(",", $list);
$count = count($array);
$arraynum = 0;
?>

<?php foreach ($eunomix_teamRecords as $et): ?>

<?php for ($offset = 0; $et['name'] == $array[$offset]; $offset++ ): ?>

<?php echo htmlencode($et['name']) ?>&nbsp;<?php echo $offset?><br />

<?php endfor?>
<br />


<?php endforeach?>

<?php endforeach?>

Hi Kyle

I think I need to see the front end result of this. Failing that, have you tried using showme() on the variables in each stage of the loops to see what exactly is going on with them? The fastest way to find out why something doesn't show up is to check what your variables are set to at the point where they should appear.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/