解析错误:语法错误,意外T_FUNCTION第10行?
2022-08-30 22:41:58
我的代码有什么问题?我在测试服务器上运行了代码,代码工作正常,但是当我将其上传到生产服务器时,我得到了
Parse error: syntax error, unexpected T_FUNCTION in /hermes/bosweb/web013/b130/ipg.acrsflcom/darayngedbeats/gentest.php on line 10
这是我的代码
$old = "http://darayngedbeats1.s3.amazonaws.com /mp3/CrazyMonsta2.mp3?AWSAccessKeyId=AKIAJXA36ESCLQHCB54Q&Expires=1297279906& Signature=HD36ZQE8yeTIW6JPWKMcciPTiTs%3D"; //enter the key that needs to be converted
$search = array(":","?","=","&","%");
$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 "<br><br>";
$new = search_replace($search,$replace,$old);
echo $new;
?>