I'm having another problem with sort(); I want to treat $rbenquiry as a string, not as a numeral.
$mydata->RB could contain "1.2" ; "1.9" ; "1.1" ; "1.0" ; "1.0.8" But if $rbenquiry ="1.0", my code spits out anything that begins as though it were ="1". It should only display "1.1" or "1.0.8". Where did I go wrong? How can I fix it? Thanks for any help, John ------- snip ------------ $rbenquiry ="1.0"; $enquiries = array(); $enquiry_list = array(); #... open $db & $ $table while ($mydata = mysql_fetch_object($news)) { $mydata->RB = str_replace(" ;", ";", $mydata->RB); $mydata->RB = str_replace("; ", ";", $mydata->RB); $tempenquiries = explode(";", $mydata->RB); foreach ($tempenquiries as $singleenquiry) { if ($singleenquiry <> "") { array_push($enquiries, $singleenquiry); $enquiry_list[$singleenquiry][] = $mydata->id; } } } sort($enquiries); #usort($enquiries, create_function('$a,$b','return strcasecmp($a,$b);')); foreach (array_count_values ($enquiries) as $enquiry=>$count) { if((strtolower(substr($enquiry, 0, 1)) == $rbenquiry)) { echo "<tr bgcolor=\"#D3DCE3\">"; echo "<th align=\"left\" colspan=\"2\"><a href=\"".$SCRIPT_NAME."?searchenquiry=".urlencode($enquiry)."\">".$enquiry."</a> <small>[<--Search Entire Database]</small></th>"; echo "<th align=\"right\" width=\"5%\" nowrap>(".$count." "; if($count > 1) {echo "records found/trouvés)";} else{echo "record found/trouvé)";} echo"</th></tr>\n"; echo "<tr bgcolor=\"#F5F5F5\"><td> </td>"; echo "<td align=\"left\">"; $temp = ""; foreach ($enquiry_list[$enquiry] as $rbid) { $temp .= "<a target=\"printwindow\" href=\"print.php?id=".urlencode($rbid)."\">".$rbid."</a>, "; } $temp = substr("$temp", 0, -2); echo "$temp</td>"; echo "<td> </td>"; echo "</tr>\n"; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php