Good error handling with file_get_contents

后端 未结 5 1654
梦如初夏
梦如初夏 2020-11-30 10:26

I am making use of simplehtmldom which has this funciton:

// get html dom form file
function file_get_html() {
    $dom = new simple_html_dom;
    $args = fu         


        
5条回答
  •  醉话见心
    2020-11-30 10:31

    Use CURL to get the URL and handle the error response that way.

    Simple example from curl_init():

    
    

提交回复
热议问题