I\'m trying to do a usort in PHP, but I can\'t access global variables inside a usort function.
I\'ve simplified my code down to bare bones to show what I mean:
Does it work if you access the variable using the super-global $GLOBALS array?
$testglobal = 1; function cmp($a, $b) { echo 'hi' . $GLOBALS['testglobal']; } usort($topics, "cmp");