Jump to content

Popstop

новички
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

1 Обычный

About Popstop

  • Rank
    Новичок

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Может так? $city_id = 20138; $url = 'https://export.yandex.ru/bar/reginfo.xml?region=' . $city_id . '.xml'; $xml = simplexml_load_file($url); $wind_direction_old = array('юг', 'север', 'запад', 'восток', 'южныйо', 'северныйо'); $wind_direction_new = array('южный', 'северный', 'западный', 'восточный', 'юго', 'северо'); foreach($xml->weather->day->day_part as $day) { echo "<br>" . $day['type']; if ($day->weather_type) { echo "<br><img data-src=\"" . $day->image_v3 . "\" alt=\"\" />"; echo "<br>" . $day->temperature; echo "<br>" . $day->weather_type; echo "<br>Ветер " . str_replace($wind_direction_old, $wind_direction_new, $day->wind_direction) . " " . $day->wind_speed . " м/с"; echo "<br>Влажность " . $day->dampness . "%"; echo "<br>Атмосферное давление " . $day->pressure . " мм рт. ст."; } else { echo "<br><img data-src=\"" . $day->image_v3 . "\" alt=\"\" />"; echo "<br>" . $day->temperature_from; echo "<br>" . $day->temperature_to; } }
×
×
  • Create New...