Monkuar Posted March 7, 2012 Share Posted March 7, 2012 these are sections of my profile, just plain right now so easier for u to read: $notes = 'notes'; $signature = 'signatures'; $friends = 'friends'; $middle=array ( "0" => array ( "section" => $notes, "hide" => "0", "c" => "apple" ), "1" => array ("section" => $signature, "hide" => "0", "c" => "apple" ), "2" => array ("section" => $friends, "hide" => "0", "c" => "apple" ), ); $order = array(2,1,0); foreach ($order as $index) { echo '<br>'.$middle[$index]['section']; } If the hide = 1 how do i hide a array in my foreach? Quote Link to comment https://forums.phpfreaks.com/topic/258428-testing-my-foreach-code/ Share on other sites More sharing options...
scootstah Posted March 7, 2012 Share Posted March 7, 2012 foreach ($order as $index) { if ($middle[$index]['hide'] != 0) echo '<br>'.$middle[$index]['section']; } Something like that? Quote Link to comment https://forums.phpfreaks.com/topic/258428-testing-my-foreach-code/#findComment-1324711 Share on other sites More sharing options...
Monkuar Posted March 7, 2012 Author Share Posted March 7, 2012 foreach ($order as $index) { if ($middle[$index]['hide'] != 0) echo '<br>'.$middle[$index]['section']; } Something like that? ROFL Thank you lol i think i had a brain fart Quote Link to comment https://forums.phpfreaks.com/topic/258428-testing-my-foreach-code/#findComment-1324712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.