Used to get content from a url through file_get_contents
. Suddenly it stopped working, I get the "Warning: fopen(https://www.cba.am/am/SitePages/ExchangeArchive.aspx): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/xocgzspq/public_html/rates/main/6zuohz.php on line xx" warning.
$url = "https://www.cba.am/am/SitePages/ExchangeArchive.aspx";
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$html = file_get_contents($url, false, stream_context_create($arrContextOptions));
BTW, getting the same issue with fopen instead of file_get_contents
.
Haven't changed anything in the code recently, please, help to resolve the issue. Thanks!