title: Parse error: syntax error, unexpected T_FUNCTION line 10?
body: <p>What is wrong with my code? I ran the code on my test server and the code worked but when I upload it to my production server I get </p>
  
  <pre><code>Parse error: syntax error, unexpected T_FUNCTION in /hermes/bosweb/web013/b130/ipg.acrsflcom/darayngedbeats/gentest.php on line 10
  </code></pre>
  
  <p>here is my code
      
  
  <pre><code>$old = "http://darayngedbeats1.s3.amazonaws.com    /mp3/CrazyMonsta2.mp3?AWSAccessKeyId=AKIAJXA36ESCLQHCB54Q&amp;Expires=1297279906&amp; Signature=HD36ZQE8yeTIW6JPWKMcciPTiTs%3D"; //enter the key that needs to be converted
  $search =  array(":","?","=","&amp;","%");
  $replace = array("%3A","%3F","%3D","%26","%25");
  
  function search_replace($s,$r,$sql)
  { $e = '/('.implode('|',array_map('preg_quote', $s)).')/';
    $r = array_combine($s,$r);
    return preg_replace_callback($e, function($v) use ($s,$r) { return $r[$v[1]];  },$sql);
  }
  
  echo "&lt;br&gt;&lt;br&gt;";
  $new = search_replace($search,$replace,$old);
  echo $new;
  
  ?&gt;
  </code></pre>