I'm trying to scrape info from this webpage: http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Wichita&site=ICT&State=KS&warnzone=KSZ083 I just want to pull the following lines: Last Update: 06/12/08, 09:53 AM CDT Weather: Mostly Cloudy Temperature: 79°F (26°C) Humidity: 67 % Wind Speed: S 9 MPH My current code is: <?php $data = file_get_contents('http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Wichita&site=ICT&State=KS&warnzone=KSZ083');preg_match_all("/Weather:(.*)<br>.*Temperature:(.*)<br>.*Humidity:(.*)<br>.*Wind Speed:(.*)<br>/Usm",$data,$results); print_r($results[0]); ?> Code (markup): This code works fine to pull the info, but for some reason it's displaying "Array ( [0] =>"..... as shown here: www.egnited.net. What should I change the code to so I can get rid of that "Array" thing? Any help would be GREATLY appreciated.... I've spent about ten hours now trying to figure it out. Thanks.
I'm sorry but I've read that and am not talented enough to figure it out. Could someone please fix the code so that it'll display the info without the "Array" thing?
Heh, try this: <?php $data = file_get_contents('http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Wichita&site=ICT&State=KS&warnzone=KSZ083');preg_match_all("/Weather:(.*)<br>.*Temperature:(.*)<br>.*Humidity:(.*)<br>.*Wind Speed:(.*)<br>/Usm",$data,$results); echo $results[0][0]; ?> PHP: Is that what you were looking for? Since it's an array within an array you just echo the second layer ($result[0][0] =]