This is something I'm curious about...
I have some arrays that contain my navigation stuff and I want to output it in three places based upon different criteria...
What I'm not sure about (although I bet the answer is 'no'), is there a way to check the conditions at the actual foreach command?
// not sure if it's possible...check conditions here? and how?
foreach ($array as $key => $val) {
do my stuff (if the conditions were met);
}
as opposed to...
foreach ($array as $key => $val) {
if (($nav[2] == 1) && ($subnav[3] == '1')) {
do my stuff (if the conditions were met);
}
}
??? Perhaps I'm being a little too picky on this particular subject? I'm ultimately trying to reduce something that is being done with three separate queries into one...I hope this makes sense...