当用支付宝支付的时候,出现了The each() function is deprecated. This message will be suppressed on further calls。
这种情况是因为PHP版本高于7.2,而each()函数已经不适合PHP7.2版本。
那么,如何解决呢?
找到路径AopClient.php下面的文件。
其中protected function buildRequestForm($para_temp)函数下面的代码,直接替换下面:
$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gatewayUrl."?charset=".trim($this->postCharset)."' method='POST'>";
foreach ($para_temp as $key => $val) {
if (false === $this->checkEmpty($val)) {
//$val = $this->characet($val, $this->postCharset);
$val = str_replace("'","'",$val);
//$val = str_replace("\"",""",$val);
$sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>";
}
}
$sHtml = $sHtml."<input type='submit' value='ok' style='display:none;''></form>";
$sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>";
return $sHtml;
以上代码经过郑州网站建设测试,可以放心直接替换。