<?
function
sortcallback($first, $second)
{
global $attrs;
global $sortkey;
if (!isset($first[$attrs[$sortkey]]) ||
!isset($second[$attrs[$sortkey]]) ||
$first[$attrs[$sortkey]]["count"] != 1 ||
$second[$attrs[$sortkey]]["count"] != 1) {
printf("one of the sort callback args is broken, dumping:\n" .
"<pre>\n");
printf("FIRST ARG GIVEN TO CALLBACK\n");
printf("type is %s\n", gettype ($first));
var_dump($first);
printf("SECOND ARG GIVEN TO CALLBACK\n\n");
printf("type is %s\n", gettype ($second));
var_dump($second);
printf("</pre>\n");
die("please report this error");
}
return strcmp($first[$attrs[$sortkey]][0],
$second[$attrs[$sortkey]][0]);
}
?>