title: Cant access global variable in function
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/894990/cant-access-global-variables-inside-a-usort-function">can&#39;t access global variables inside a usort function?</a>  </p>
  </blockquote>
  
  
  
  <p>I've experienced this problem more then one time now, and I this time I couldnt figure out how to get around it.</p>
  
  <pre><code>$testing = "hej";
  function compare($b, $a)
  {
      global $testing;
      echo '&lt;script&gt;alert(\'&gt;'.$testing.'&lt;\');&lt;/script&gt;';
  }
  </code></pre>
  
  <p>Why does this not show a alertbox with ">hej&lt;", for me it shows ">&lt;".</p>
  
  <p>Also, this is a function that is call from <code>uasort</code> as second parameter.</p>