I have a class called Link with a function called Compare. When I runt this code I keep getting an error message
foreach($filearray as $k=>$v)
{
$website = new Link($v);
$links[] = $website;
}
usort($links, array("Link","compare"));
But I get an error message and I cant figure out why...
"Warning: usort() [function.usort]: The argument should be an array"
If
$linkshaven't been initialized as an array, when$filearrayis empty,$linksremainsnull.Add
$links = array();before the loop.