php - Getting the name of an array dynamically -


i have array looks this:

$example = [              ['rendered'][0]['rendereditem1']              ['rendered'][4]['rendereditem2 , more']              ['rendered'][2]['rendereditem3'] ] 

now want iterate foreach contents of 0,4,2!

normally write:

foreach($example $value){     print $value['rendered'][int same everywhere]; } 

but not working because array name different...how iterate in case?

simply add second loop iterate on members :

foreach($example $value) {   foreach($value['rendered'] $key=>$item) {     // want here, $key 0,4,2 in example   } } 

Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -