I'm having a hard time getting this to print...here's how it's setup...
$top = array('a','b','c');
$bottom = array(
array('123','a'),
array('456','a'),
array('678','c'),
array('234','b'),
array('435','a'),
array('423','c'));
I'm trying to output a loop based upon the members of $top and for each $top output the values $bottom where the second [1] element in each array equal $top.
Something along the lines...well, something...this isn't work for the obvious reason but I'm not quite sure how to tackle it:
foreach ($top as $atop) {
foreach ($bottom as $abottom) {
if ($atop = $abottom[1]) {
$line .= $atop . ' - ' . $abottom[1];
}
}
$out = $line;
}
Ack...I hope that's not confusing. I have to reiterate the same array ($abottom) three times and...is that possible? It will iterate just fine through $atop. The other issue is that I can't quite figure out a decent way to get my $line and move it to $out properly.
Tips?