I'm trying to limit the output of the following code to 5 or 10 results but I can't figure out how to do it. I've tried several things but can't seem to make it work. The following code outputs all info in $p_array. Any help would be greatly appreciated.
$si = 0;
while (list ($key, $value) = each ($p_array)) {
//ROW COLOR
$tbgcolor = is_int($si / 2)?"#efefef":"#ffffff";
$p_stats .= "
<tr bgcolor=\"".$tbgcolor."\" align=\"center\">
<td class=\"table_text\">"
.$value["fname"]." ".$value["lname"]."</td>
<td class=\"table_text\">".$value["team"]."</td>
<td class=\"table_text\">".$value["pts"]."</td>
</tr>";
$si++;
}