PHP Foreach Help - Display only for Items Under Condition?

foreach($shouts as $sbox) {
$count++;
// We'll split it into another array with list and explode.
// If you have changed the way data stored, please modify the following line too
list($recipient,$sender,$read,$avatar,$date,$time,$ipaddr,$message) = explode(" | ", $sbox);

$shout = " ".$shout;
$shout = preg_replace($link_search, $link_replace, $shout);
$shout = preg_replace("/\\'/", "`", $shout);
$shout = preg_replace($sm1,$sm2,$shout);

$shout = chop($shout);

// Now, we have to output it!
echo "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"SB_table$rowColor\"><tr><td class=\"SB_shoutbox\" title='$time $date'><img src='avatars/$avatar'><b>$sender</b>: $message<i>($time)</i></td></tr></table>\n";

if ($rowColor==0) $rowColor = 1;
else $rowColor = 0;
}

I want to make it so that it only displays items in the array where $recipient = $name

How would I do that?
 
Back
Top