Well I will not take credit for these codes as I found it but I would appreciate if someone can help me display the weather with this following coding I will really appreciate it.
$BASE_URL = "http://query.yahooapis.com/v1/public/yql";
$yql_query = 'select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="sc")';
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json";
// Make call with cURL
$session = curl_init($yql_query_url);
curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
$json = curl_exec($session);
// Convert JSON to PHP object
$phpObj = json_decode($json);
echo '<pre>';print_r($phpObj).'<pre>';
I just want this code to display the weather of a particular place with some variable which I can echo like
echo $city;
echo $temp;
something like this.
really thank you for your valuable time and kindness for helping
ok i got it and sharing the codes so that it could be of use to someone who is looking for weather api