Php 不推荐使用的拆分函数的替代方案是什么

Php 不推荐使用的拆分函数的替代方案是什么,php,Php,有人能帮我知道如何处理不推荐使用的函数拆分吗。 我只是对PHP不太了解,希望能对我的代码进行更正,以停止显示错误 我听到一个错误,说 不推荐使用:C:\wamp\www\msacco\sendsms.php第84行的函数split()不推荐使用 第84行具有以下语法 $aux=split(“\r\n”,$responsecontent); 这里的代码是第17行 如何正确替换此拆分函数以停止在页面上显示错误 代码块是 else { $salida ="P

有人能帮我知道如何处理不推荐使用的函数拆分吗。 我只是对PHP不太了解,希望能对我的代码进行更正,以停止显示错误

我听到一个错误,说 不推荐使用:C:\wamp\www\msacco\sendsms.php第84行的函数split()不推荐使用

第84行具有以下语法 $aux=split(“\r\n”,$responsecontent); 这里的代码是第17行

如何正确替换此拆分函数以停止在页面上显示错误

代码块是

       else {
               $salida ="POST $uri  HTTP/1.1\r\n";
               $salida.="Host: $host\r\n";
               $salida.="User-Agent: PHP Script\r\n";
               $salida.="Content-Type: text/xml\r\n";
               $salida.="Content-Length: ".strlen($postdata)."\r\n";
               $salida.="Connection: close\r\n\r\n";
               $salida.=$postdata;
               fwrite($da, $salida);
               $response = "";
               while (!feof($da))
                       $response.=fgets($da, 128);
               $response=split("\r\n\r\n",$response);
               $header=$response[0];
               $responsecontent=$response[1];
               if(!(strpos($header,"Transfer-Encoding: chunked")===false)){
                       $aux=split("\r\n",$responsecontent);
                       for($i=0;$i<count($aux);$i++)
                               if($i==0 || ($i%2==0))
                                       $aux[$i]="";
                       $responsecontent=implode("",$aux);
               }//if
               return chop($responsecontent);
       }
else{
$salida=“POST$urihttp/1.1\r\n”;
$salida.=“主机:$Host\r\n”;
$salida.=“用户代理:PHP脚本\r\n”;
$salida.=“内容类型:text/xml\r\n”;
$salida.=“内容长度:”.strlen($postdata)。“\r\n”;
$salida.=“连接:关闭\r\n\r\n”;
$salida.=$postdata;
fwrite($da,$salida);
$response=“”;
而(!feof($da))
$response.=fgets($da,128);
$response=split(“\r\n\r\n”,$response);
$header=$response[0];
$responsecontent=$response[1];
if(!(strpos($header,“传输编码:分块”)==false)){
$aux=split(“\r\n”,$responsecontent);
对于($i=0;$i您想要的:

从文档中可以看出:“
split()
从PHP 5.3.0开始就被弃用。
preg_split()
是此函数的建议替代方案。如果不需要正则表达式的强大功能,使用
explode()
会更快,这不会产生正则表达式引擎的开销。”
$response = explode("\r\n\r\n", $response);