I have the following website: http://stationmeteo.meteorologic.net/metar/your-metar.php?icao=LFRS&day=070308
I want to extract data from it. I tried using file_get_contents and some regular expressions, but something is not working.
this is the code I tried:
$content=file_get_contents('http://stationmeteo.meteorologic.net/metar/your-metar.php? icao=LFMN&day=010513');
preg_match('/00\:30 07\/03\/2008(.+)01\:30 07\/03\/2008/',$content,$m);
echo $m[0];
echo $m[1];
It's giving me undefined offset 0 and 1. If I copy the content of the web page directly to $content instead of using file_get_contents, it works fine.
What am I missing?
file_get_contents(...), what are your getting in $content ?00:00 01/05/2013?file_get_contentsreturning something at all?