Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $temp_data_user = file_get_contents('http://ipinfo.io/'.$_SERVER['REMOTE_ADDR'].'/json');
- $data_user = json_decode($temp_data_user,true);
- $cords = explode(',',$data_user['loc']);
- $temp_data_weather = file_get_contents('http://api.openweathermap.org/data/2.5/weather?units=metric&lat='.$cords[0].'&lon='.$cords[1]);
- $data_weather = json_decode($temp_data_weather,true);
- print_r($data_weather);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement