在线咨询
微信咨询
服务热线
服务热线:15639912513
TOP
当前位置:
首页 > 新闻中心> PHP课堂>支付宝The each() function is deprec…

支付宝The each() function is deprecated.

发布时间:2023-06-22 浏览:2225次

当用支付宝支付的时候,出现了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("'","&apos;",$val);

              //$val = str_replace("\"","&quot;",$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;

以上代码经过郑州网站建设测试,可以放心直接替换。


TAG
2225
该内容对我有帮助
上一篇:没有了
返回列表