How to loop through the array with conditions this post finally by albb_num1 in 2014-10-1820: 47: 12 edit the following array $ abcarray (& nbsp; & nbsp; [navigation_list] & nbsp; & gt; & nbsp; Array & nbsp; & nbs how to loop arrays with conditions
This post was last edited by albb_num1 at 20:47:12
The following array
$ Abc = array (
[Navigation_list] => Array
(
[0] => Array
(
[Navigation_id] => 1
[Navigation_title] => Question 1
[Navigation_link] => http: // 127.0.0.1/
[Navigation_sort] = & gt; 255
[Navigation_open_type] => 1
)
[1] => Array
(
[Navigation_id] => 2
[Navigation_title] => Question 2
[Navigation_link] => http: // 127.0.0.1/circle
[Navigation_sort] = & gt; 255
[Navigation_open_type] => 1
)
[2] => Array
(
[Navigation_id] => 3
[Navigation_title] => Question 3
[Navigation_link] => http: // 127.0.0.1/microshop
[Navigation_sort] = & gt; 255
[Navigation_open_type] => 1
)
[3] => Array
(
[Navigation_id] => 4
[Navigation_title] => Question 4
[Navigation_link] => http: // 127.0.0.1/shop/index. php? Act = brand
[Navigation_sort] = & gt; 255
[Navigation_open_type] => 1
)
)
)
If I want to loop out the next two arrays, that is, the first two are not allowed, how can I write conditions?
The following code is written by me. Why can't we loop it out? what's wrong:
if ($abct[navigation_list][navigation_id]>2 || $output[navigation_list][navigation_id]>5){
foreach($output['navigation_list'] as $value) {?>
"
>
------ Solution ----------------------
foreach($abc['navigation_list'] as $value) {?>
2){ ?>