After poking at this for an hour, I'm stuck. All the commented out urls work just fine. The gov data one fails though. Any thoughts?
// $url = 'http://en.wiktionary.org/w/api.php?format=json&action=query&titles=work&rvprop=content&prop=revisions&redirects=1';
$url = "http://forecast.weather.gov/MapClick.php?lat=39.1666&lon=-86.5215&unit=0&lg=english&FcstType=dwml";
//$url = 'http://www.reddit.com/r/bloomington/.rss';
//$url = "http://forecast.weather.gov/MapClick.php?lat=34.12699&lon=-118.27381&unit=0&lg=english&FcstType=dwml";
$myReadAccess=new ReadFile($url);
if(!$data=$myReadAccess->getFileContents()){
//ERROR, DISPLAY ERROR MESSAGE
echo "Error: " . $myReadAccess->getError();
}
else{
//SUCCESS, DISPLAY FILE CONTENTS
echo $data;
}
Read File Class http://pastebin.com/8pQxfsz7
Try to use cURL
I've tried your code and it produces this error.
Then I came across this link and everything works just fine.
Hope it helps..