I am trying to get text from the following url.
http://stp.stheadline.com/data/indexNewsMarquee.json
I tried several methods, but none of them worked. I am really desperate right now, please help me and thanks in advance.
PS I have already enabled allow_url_fopen in my ini.php. Postscript I am using XAMPP v3.3.2 and PHP v5.6.23
The following codes I tried (and failed)
Curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
Result: Empty string
file_get_contents
echo file_get_contents($url, true);
Result: Could not open stream: HTTP request failed!
ReadFile
echo readfile($url)
Result: displays the address itself