Multiple includes in a foreach loop

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 19, 2020   (RSS)

By Toledoh - October 18, 2020

Hi All.

Can anyone explain to me why the first option includes _panelContent.php only once, but the second option includes multiples?  (I need multiples)

Option 1:

<?php foreach ($panelsRecords as $record): ?>

<?php include("_panelContent.php") ?>

<?php endforeach ?>

Option 2:

<?php foreach ($panelsRecords as $record); include("_panelContent.php"); ?>

Cheers,

Tim (toledoh.com.au)

By Toledoh - October 19, 2020

Thanks Carl!

Cheers,

Tim (toledoh.com.au)