file_get_contents() how to fix error “Failed to open stream”, “No such file”

后端 未结 8 925
傲寒
傲寒 2020-12-01 17:35

I\'m getting the following error when I try to run my PHP script:

failed to open stream: No such file or directory in C:\\wamp\\www\\LOF\\Data.php on

8条回答
  •  庸人自扰
    2020-12-01 18:27

    We can solve this issue by using Curl....

    function my_curl_fun($url) {
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
     $data = curl_exec($ch);
     curl_close($ch);
     return $data;
    }
    
    $feed = 'http://................'; /* Insert URL here */
    $data = my_curl_fun($feed);
    

提交回复
热议问题