代码运行时报错解决方法
程序员文章站
2024-02-02 09:34:58
...
代码运行时报错
preg_match( "/Location:(.*?)\\n/", $header, $matches );
$url = @parse_url( @trim( @array_pop( &$matches ) ) );
if ( !$url)
{
$curl_loops = 0;
return $data;
}
$last_url = parse_url( curl_getinfo( $ch, CURLINFO_EFFECTIVE_URL ) );
if ( !$url['scheme'] )
{
$url['scheme'] = $last_url['scheme'];
}
上面这段代码运行时也报错:Warning: Call-time pass-by-reference has been deprecated in E:\PHPnow-1.5.6\htdocs\source\core\util\class.curl.php on line 229
229行代码是:$url = @parse_url( @trim( @array_pop( &$matches ) ) );
------解决方案--------------------
$url = @parse_url( @trim( @array_pop( $matches ) ) );
preg_match( "/Location:(.*?)\\n/", $header, $matches );
$url = @parse_url( @trim( @array_pop( &$matches ) ) );
if ( !$url)
{
$curl_loops = 0;
return $data;
}
$last_url = parse_url( curl_getinfo( $ch, CURLINFO_EFFECTIVE_URL ) );
if ( !$url['scheme'] )
{
$url['scheme'] = $last_url['scheme'];
}
上面这段代码运行时也报错:Warning: Call-time pass-by-reference has been deprecated in E:\PHPnow-1.5.6\htdocs\source\core\util\class.curl.php on line 229
229行代码是:$url = @parse_url( @trim( @array_pop( &$matches ) ) );
------解决方案--------------------
$url = @parse_url( @trim( @array_pop( $matches ) ) );
相关文章
相关视频
下一篇: 搭建最小MySQL环境