PHP usort() expects parameter 2 to be a valid callback, not in a class
<p>I have a problem with usort not liking the second parameter (the sorting function). I have seen a lot of questions about this being a problem when in a class, and the answer for that is to pass an array of <code>array($this, functionName)</code>
But in my case this is not working. The script is not a class, but I am getting this error:</p>

<pre><code>PHP Warning:  usort() expects parameter 2 to be a valid callback, function 'cmp' not found or invalid function name in &lt;filename.php&gt;
</code></pre>

<p>So what is the problem with the second parameter, the function name, not being found? This is example code straight from the PHP website.</p>