PHP Classes

callback functions

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  callback functions  
Subject:callback functions
Summary:Use of undefined constant when calling callback using usort
Messages:3
Author:Brian Read
Date:2009-05-18 14:44:54
Update:2009-05-19 10:25:39
 

  1. callback functions   Reply   Report abuse  
Picture of Brian Read Brian Read - 2009-05-18 14:44:54
I have:

Function whatever(){
function roomcmp($a, $b)
{
if ($a["MealType"]["Text"] == $a["MealType"]["Text"]) {
return 0;
}
return ($a["MealType"]["Text"] < $b["MealType"]["Text"]) ? -1 : 1;
}
..............
usort($roomarray,roomcmp);
..............
}

and I get

"Use of undefined constant roomcmp - assumed 'roomcmp'".

How am I meant to declare roomcmp?

Cheers

Brain

There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.