$data_file="https://export.yandex.ru/bar/reginfo.xm ... xml?".rand(); // адрес xml файла
$xml = simplexml_load_file($data_file); // раскладываем xml на массив
sg("PogodaYavObn.City",$xml->weather->day->title);
sg("PogodaYavObn.Country",$xml->weather->day->country);
sg("PogodaYavObn.SunRise",$xml->weather->day->sun_rise);
sg("PogodaYavObn.SunSet",$xml->weather->day->sunset);
sg("PogodaYavObn.Type",$xml->weather->day->day_part->weather_type);
sg("PogodaYavObn.Code",$xml->weather->day->day_part->weather_code);
sg("PogodaYavObn.WindSpeed",$xml->weather->day->day_part->wind_speed);
sg("PogodaYavObn.WindDir",$xml->weather->day->day_part->wind_direction);
sg("PogodaYavObn.Humidity",$xml->weather->day->day_part->dampness);
sg("PogodaYavObn.Hectopascal",$xml->weather->day->day_part->hectopascal);
sg("PogodaYavObn.Torr",$xml->weather->day->day_part->torr);
sg("PogodaYavObn.Pressure",$xml->weather->day->day_part->pressure);
sg("PogodaYavObn.Temp",$xml->weather->day->day_part->temperature);
sg("PogodaYavObn.Observ_time",$xml->weather->day->day_part->observation_time);
//sg("PogodaYavObn.Image",$xml->weather->day->day_part->image-v3);
sg("PogodaYavObn.Image",$xml->weather->day->day_part->image);
Код XML страницы выглядит так
<weather_type>переменная облачность</weather_type>
<weather_code>partly-cloudy</weather_code>
<image>
https://yastatic.net/weather/i/icons/bl ... /bkn_d.png
</image>
<image-v2 size="22x22">
http://yandex.st/weather/v-1/i/icons/22 ... _d_-12.png
</image-v2>
<image-v3 size="48">
https://yastatic.net/weather/i/icons/bl ... /bkn_d.png
</image-v3>