PHP simplexml_load_file catch 403

前端 未结 2 1366
一向
一向 2021-01-25 06:47

I am using the following PHP:

$xml = simplexml_load_file($request_url) or die(\"url not loading\");

I use:

$status = $xml->R         


        
2条回答
  •  甜味超标
    2021-01-25 07:22

    You'll have to use something like the cURL module or the HTTP module to fetch the file, then use the functionality provided by them to detect an HTTP error, then pass the string from them into simplexml_load_string.

提交回复
热议问题