loops - php foreach help -
I have a dataset with 4 rows. I am using 2 foreign loops to extract my data. Once the external seal loop is needed and I need an internal loop for loop 4x. Is there a way to do this or do I need to divide the array?
foreach ($ key => report as $ val) {if ($ val ['rpt_type'] = = 'soy') {foreach ($ val as $ Foo) {echo $ foo ['name']; }}}}
I am still unsure what your data structure looks like To be able to use "rpt_type", something like this should be seen:
$ report = array (0 = & gt; array ('rpt_type' = & gt; '... ', ...' rows' = & gt; array ('name' = & gt; '...', ...),), 1 = & gt; ...); Then you can iterate over it with:
foreach ($ Report $ as report) {if ($ report ['rpt_type '] ==' Soya '(Foreign currency ($ report [' rows'] as $ line) {echo $ line ['name'];}}}
Comments
Post a Comment