开发者

How to get an array repeat in foreach loop

开发者 https://www.devze.com 2023-02-22 07:10 出处:网络
This is my $settings array.开发者_开发知识库... and I would like to look this array in foreach so that I can read the $settings[\'node\'][\'type\'][$value[\'type\']][\'modifiers\'] values in foreach l

This is my $settings array.开发者_开发知识库... and I would like to look this array in foreach so that I can read the $settings['node']['type'][$value['type']]['modifiers'] values in foreach loop and print them.


I'm can only guess you want to iterate over each element in your array.

foreach($settings as $node=>$types){
    foreach($types as $values=>$modifiers){
      \\ etc etc etc

         echo "Settings: $node $types $values $modifiers";

    }
}

Just keep nesting the foreach loops for each element you want to iterate.

0

精彩评论

暂无评论...
验证码 换一张
取 消