Is it possible to pull the current weather temperature and add 1 degree to it?
Just trying to full around with Curl for the first time and can not find much documentation on how to do something like this.
Well, you will need to find a weather provider to do that. Something like... http://www.google.com/ig/api?weather=The+Hague
Now, you could retrieve that information with cURL, then parse the XML to find current_conditions/temp_c, and then add 1 to that.
Find out exactly what curl is bringing back, and what type PHP interprets it to be before simply adding a 1 to it.
Myruns on forever.PHP Code:
And when it returns the value $e. I can not get any math out of it.
right now $e echos 2.8. But that changes every so often. But when i try to add
returns 2PHP Code:
$e + 1 = $f
$html = file_get_html('https://btc-e.com/exchange/');
foreach($html->find('span#min_price') as $e)
echo $e->innertext . '<br>';
I copied the entire code above^.
It pulls the current rate off btc-e for bitcoins in usd.
the 2.8 changes.
I have the cURL pulling the correct info, Just not sure how to alter it. I want to be able to take the current rate $e.
and increase it by a percent.
Maybe its the way you are adding the values up? This all works for me:
$fl = (float) 2.8;
$st = "2.8";
// float 2.8
// float 3.8
// string '2.8' (length=3)
// float 3.8