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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -