I am trying to get the text from the following url. http://stp.stheadline.com/data/indexNewsMarquee.json
I have tried several methods but none of them worked. I am really desperate right now please help me and thanks in advance.
P.S. I have enabled allow_url_fopen in my ini.php already. P.S. I am using XAMPP v3.3.2 and PHP v5.6.23
the following are the codes that I have 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: failed to open stream: HTTP request failed!
readfile
echo readfile($url)
result: output the address itself