I have the following code to parse Yahoo Weather Info:
$xml = simplexml_load_file('http://weather.yahooapis.com/forecastrss?w=868274&u=c'); $weatherInfo = $xml->channel->item->description; $imagePattern = '/src="(.*?)"/i'; preg_match($imagePattern, $weatherInfo, $matches); $imageSrc = $matches[1]; $degreesPattern = '/.*?, (\d+) C/i'; preg_match($degreesPattern, $weatherInfo, $matches); $degrees = $matches[1]; echo $degrees;
How can I change the parser to work in negative degrees?
Thanks.
source share