{"id":233243,"date":"2014-08-13T18:51:03","date_gmt":"2014-08-13T14:51:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=233243"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=233243","title":{"rendered":"<span class=\"post_title\">\u0418 \u0441\u043d\u043e\u0432\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430: \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0442\u043e\u043a, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u0442\u0430 \u043e \u043f\u043e\u0433\u043e\u0434\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/232529\/\">\u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445\u00bb<\/a>. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0435\u0449\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430, \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/396\/e51\/25e\/396e5125ecb34b8fbe3ad649695d13e7.jpg\"\/><a name=\"habracut\"><\/a><\/p>\n<h5>\u0417\u0430\u0434\u0430\u0447\u0430<\/h5>\n<p>  \u041d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0434\u0430\u0432\u0430\u043b \u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u044b \u0441 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 10 \u0434\u043d\u0435\u0439 \u0441 \u0440\u0443\u0441\u0441\u043a\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u0443\u0442\u043e\u043a \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0433\u043e\u0440\u043e\u0434\u0443.<\/p>\n<h5>\u041f\u043e\u0438\u0441\u043a\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u041e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043e\u0442\u0434\u0430\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u044b, \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430, \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438.<br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0433\u043e\u0440\u043e\u0434\u0443, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u044d\u0442\u043e \u043d\u0430\u0448\u0435\u043b \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 (id) \u0433\u043e\u0440\u043e\u0434\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c <a href=\"http:\/\/weather.yandex.ru\/static\/cities.xml\">\u0437\u0434\u0435\u0441\u044c <\/a> \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 <i>export.yandex.ru\/weather-ng\/forecasts\/<b>&lt;id \u0433\u043e\u0440\u043e\u0434\u0430&gt;<\/b>.xml<\/i>. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b xml-\u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u043f\u043e\u0433\u043e\u0434\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0439 \u0433\u043e\u0440\u043e\u0434\u0430.<\/p>\n<h5>\u0420\u0430\u0437\u0431\u043e\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h5>\n<p>  \u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u044b. \u0412 xml-\u0444\u0430\u0439\u043b\u0435 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d \u043a\u0430\u043a <b>image-v3<\/b>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u044f \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0430\u0440\u0441\u0438\u0442 \u0433\u043e\u0440\u043e\u0434\u0430 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u0432\u044b\u0432\u043e\u0434.<\/p>\n<pre><code class=\"php\">\/\/ \u043f\u0430\u0440\u0441\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 $col = 1; \/\/ \u043a\u043e\u043b-\u0432\u043e \u0434\u043d\u0435\u0439 (\u0434\u043e 10, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0434\u0430\u0447\u0438) $data_file = 'http:\/\/weather.yandex.ru\/static\/cities.xml'; $xml = simplexml_load_file($data_file);  foreach ($xml-&gt;country as $key =&gt; $value) { \tforeach ($value-&gt;city as $key1 =&gt; $value1): \t\t$out = getWeather($value1[&quot;id&quot;], $col); \t\tforeach ($out as $day): \t\t\tforeach ($day['weather'] as $weather): \t\t\t\t$types[(string)$weather['weather_type']] = (string)$weather['image'];  \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \t\t\t\t$images[(string)$weather['image']] = (string)$weather['weather_type']; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \t\t\tendforeach; \t\tendforeach; \tendforeach; } foreach($types as $type=&gt;$img): \t?&gt;&lt;img src=&quot;http:\/\/yandex.st\/weather\/1.2.61\/i\/icons\/48x48\/&lt;?php echo $img;?&gt;.png&quot; width=&quot;48&quot; height=&quot;48&quot; \/&gt; - &lt;?php echo $type.'&lt;br \/&gt;'; endforeach; echo '&lt;br&gt;&lt;hr&gt;&lt;br&gt;'; foreach($images as $img=&gt;$type): \t?&gt;&lt;img src=&quot;http:\/\/yandex.st\/weather\/1.2.61\/i\/icons\/48x48\/&lt;?php echo $img;?&gt;.png&quot; width=&quot;48&quot; height=&quot;48&quot; \/&gt; - &lt;?php echo $type.'&lt;br \/&gt;'; endforeach; \/* \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0433\u043e\u0440\u043e\u0434\u0430, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b - \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e *\/ function getWeather($city, $col = 10) { \t$data_file = 'http:\/\/export.yandex.ru\/weather-ng\/forecasts\/'.$city.'.xml';   \/\/ \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 \u043f\u043e\u0433\u043e\u0434\u044b \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u043e\u0440\u043e\u0434\u0430 \t$xml = simplexml_load_file($data_file); \/\/ \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c xml \u0444\u0430\u0439\u043b \u0447\u0435\u0440\u0435\u0437 simple_xml  \t$out = array(); \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 \t$counter = 0 ; \/\/ \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043d\u0435\u0439, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u0440\u043e\u0433\u043d\u043e\u0437  \tif($xml-&gt;day): \t\tforeach($xml-&gt;day as $day):  \t\t\tif($counter == $col) break; \t\t\tfor ($i=0;$i&lt;=3;$i++) { \t\t\t\t$out[$counter]['weather'][$i]['image'] = $day-&gt;day_part[$i]-&gt;{'image-v3'}; \t\t\t\t$out[$counter]['weather'][$i]['weather_type'] = $day-&gt;day_part[$i]-&gt;weather_type; \t\t\t} \t\t\t$counter++ ; \t\tendforeach; \tendif; \treturn $out ; } <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0438\u0434\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u0425\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u044b. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>$col<\/b> \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 10, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 1, \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u0434\u0430\u0447\u0438.<\/p>\n<p>  <em><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0441\u043a\u0440\u0438\u043f\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u0445\u043e\u0441\u0442\u0435), \u0442.\u043a. \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f php-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 (max_execution_time, max_input_time), \u0430 \u0442\u0430\u043a \u0436\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (memory_limit).<\/em><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0448\u0435\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\u0422\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u044b.<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/47e\/dde\/011\/47edde011b164b82b193d3c32a213700.png\" width=\"48\" height=\"48\"\/> bkn_-ra_d \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e \u0441 \u043f\u0440\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043e\u0436\u0434\u044c (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/8eb\/ea7\/5ed\/8ebea75edeec405287d87a46d82f043f.png\" width=\"48\" height=\"48\"\/> bkn_-ra_n \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e \u0441 \u043f\u0440\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043e\u0436\u0434\u044c (\u043d\u043e\u0447\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/ec2\/5e7\/1d1\/ec25e71d16e14cc08efa996ff1aa80ec.png\" width=\"48\" height=\"48\"\/> bkn_-sn_d \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e \u0441 \u043f\u0440\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043d\u0435\u0433 (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/dcd\/96e\/251\/dcd96e2511d8405a95a683a53d43e518.png\" width=\"48\" height=\"48\"\/> bkn_-sn_n \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e \u0441 \u043f\u0440\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043d\u0435\u0433 (\u043d\u043e\u0447\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/949\/6d7\/b4c\/9496d7b4c2ae4da9b9efbde9d7a9f962.png\" width=\"48\" height=\"48\"\/> bkn_d \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/90d\/219\/61c\/90d21961cf754d53895638cf4314aa7b.png\" width=\"48\" height=\"48\"\/> bkn_n \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c (\u043d\u043e\u0447\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/e4e\/e2f\/c0e\/e4ee2fc0ec8e41eabeef667d0ffbe4fe.png\" width=\"48\" height=\"48\"\/> bkn_ra_d \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u0434\u043e\u0436\u0434\u044c (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/e2d\/770\/a80\/e2d770a807d44f16a83c0ac4e7513774.png\" width=\"48\" height=\"48\"\/> bkn_ra_n \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u0434\u043e\u0436\u0434\u044c (\u043d\u043e\u0447\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/7e4\/36b\/4f1\/7e436b4f1c244b8e9ff25fc7e369bc2c.png\" width=\"48\" height=\"48\"\/> bkn_sn_d \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u0441\u043d\u0435\u0433 (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/b92\/e06\/c84\/b92e06c840384870831aa70cb8f0b514.png\" width=\"48\" height=\"48\"\/> bkn_sn_n \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u0441\u043d\u0435\u0433 (\u043d\u043e\u0447\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/0bc\/b15\/c41\/0bcb15c4195048b59c271f36274c0fbc.png\" width=\"48\" height=\"48\"\/> bl \u2014 \u043c\u0435\u0442\u0435\u043b\u044c<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/eb7\/d61\/512\/eb7d615121864feabbe8f8daa039c6a4.png\" width=\"48\" height=\"48\"\/> fg_d \u2014 \u0442\u0443\u043c\u0430\u043d<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/693\/bf6\/2e9\/693bf62e913144db9d001b7ce348a537.png\" width=\"48\" height=\"48\"\/> ovc \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/2fa\/5b9\/bca\/2fa5b9bca3b5400ba9fd703c6402e3b5.png\" width=\"48\" height=\"48\"\/> ovc_-ra \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438 \u0434\u043e\u0436\u0434\u044c<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/ac7\/bf2\/c54\/ac7bf2c54476438fa6f0b5b16e340335.png\" width=\"48\" height=\"48\"\/> ovc_-sn \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u043d\u0435\u0433<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/97d\/e1b\/13c\/97de1b13ca5c427a8484f88dadd77d65.png\" width=\"48\" height=\"48\"\/> ovc_ra \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0434\u043e\u0436\u0434\u044c<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/380\/129\/f81\/380129f8188545b096eb9e6c0a0cbfa5.png\" width=\"48\" height=\"48\"\/> ovc_sn \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0441\u043d\u0435\u0433<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/bdf\/bb9\/072\/bdfbb9072edb4631a5eba2263381c4c5.png\" width=\"48\" height=\"48\"\/> ovc_ts_ra \u2014 \u043e\u0431\u043b\u0430\u0447\u043d\u043e, \u0434\u043e\u0436\u0434\u044c, \u0433\u0440\u043e\u0437\u0430<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/faf\/bec\/397\/fafbec39704b4139b8bb60b1e4f27bb7.png\" width=\"48\" height=\"48\"\/> skc_d \u2014 \u044f\u0441\u043d\u043e (\u0434\u0435\u043d\u044c)<br \/>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/38d\/aab\/00a\/38daab00a7104faeae55ade2e0c07933.png\" width=\"48\" height=\"48\"\/> skc_n \u2014 \u044f\u0441\u043d\u043e (\u043d\u043e\u0447\u044c)<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043a\u043e\u043d\u043a\u0438, \u043d\u043e \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0433\u0434\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435, \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0441\u0430\u0434\u043a\u043e\u0432.<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/dfa\/991\/104\/dfa991104f454592a3c22edab1a2fc6c.png\" width=\"48\" height=\"48\"\/> bkn_+ra_d, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/3e5\/35b\/fa7\/3e535bfa70de4c918c1542b08399f713.png\" width=\"48\" height=\"48\"\/> bkn_+ra_n, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/94f\/b17\/574\/94fb17574009401ea5f4775bb3224fce.png\" width=\"48\" height=\"48\"\/> bkn_+sn_d, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/8bc\/4be\/113\/8bc4be113aca47638d895038cbe35d93.png\" width=\"48\" height=\"48\"\/> bkn_+sn_n, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/a6f\/e08\/796\/a6fe08796bd74e519ac5c92b34ca597f.png\" width=\"48\" height=\"48\"\/> ovc_+ra, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/a28\/608\/a71\/a28608a71c65490f9536c9a82ffe35b4.png\" width=\"48\" height=\"48\"\/> ovc_+sn  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438<\/h5>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u043d\u0430\u0448\u0435\u043b \u0432\u0441\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c xml-\u0444\u0430\u0439\u043b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0433\u043e\u0440\u043e\u0434\u0430 \u0438 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0443. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e \u043a\u0440\u043e\u043d\u0443, \u0440\u0430\u0437 \u0432 \u043f\u043e\u043b\u0447\u0430\u0441\u0430, \u0434\u0430\u0431\u044b \u043d\u0435 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u042f\u043d\u0434\u0435\u043a\u0441:<\/p>\n<pre><code class=\"php\">$city_id = 27612; \/\/ id \u041c\u043e\u0441\u043a\u0432\u044b $url = 'http:\/\/export.yandex.ru\/weather-ng\/forecasts\/'.$city_id.'.xml'; $userAgent = 'Googlebot\/2.1 (+http:\/\/www.google.com\/bot.html)'; $xml = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'weather_'.$city_id.'.xml'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $output = curl_exec($ch); $fh = fopen($xml, 'w'); fwrite($fh, $output); fclose($fh); <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 (\u043a\u0430\u043a \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/232529\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435<\/a>), \u043a\u043e\u043c\u0443 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0439, \u043d\u043e \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0435.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 xml-\u0444\u0430\u0439\u043b \u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0443. \u0414\u0430\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u044f \u0441\u043a\u043e\u043c\u043f\u043e\u043d\u0443\u044e \u0432\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<pre><code class=\"php\">$city_id = 27612; \/\/ id \u041c\u043e\u0441\u043a\u0432\u044b $xml = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'weather_'.$city_id.'.xml'; if(file_exists($xml)): \t$data = simplexml_load_file($xml); \/\/\u0433\u0440\u0443\u0437\u0438\u043c ?&gt; \t&lt;style type=&quot;text\/css&quot;&gt; \t.weather{position:relative;border-bottom:1px solid #d5d5d5;padding-bottom:35px;} \t.weather .date{font-size:13px;font-weight:700;padding-bottom:5px;text-transform:uppercase;border-bottom:1px solid #d5d5d5;margin-top:10px;} \t.weather .item{background-color:#f0eedc;padding:15px;font-family:Georgia;margin-bottom:20px;} \t.weather .item table{border:0;width:100%;} \t.weather .item table td{padding-bottom:15px;width:20%;vertical-align:baseline;padding-right:5px;} \t.weather .item .day-part td{font-size:18px;} \t.weather .item .day-temp td{font-size:30px;} \t.weather .item .day-temp td img{margin-left:5px;} \t.weather .item .day-param td{font-size:12px;} \t.weather .item .day-param td p{padding-bottom:3px;} \t.weather .days{margin-top:35px;border:0;width:100%;} \t.weather .days td{width:50%;padding-bottom:35px;} \t.weather .days a{font-family:Georgia;font-size:18px;text-decoration:underline;font-weight:700;} \t&lt;\/style&gt; \t&lt;div class=&quot;weather&quot;&gt;&lt;?php \tforeach($data-&gt;day as $day):?&gt; \t\t&lt;div class=&quot;date&quot;&gt;&lt;?php echo getDayDate($day['date']);?&gt;&lt;\/div&gt; \t\t&lt;div class=&quot;item&quot;&gt; \t\t\t&lt;table&gt; \t\t\t\t&lt;tr class=&quot;day-part&quot;&gt; \t\t\t\t\t&lt;td&gt;\u0423\u0442\u0440\u043e\u043c&lt;\/td&gt; \t\t\t\t\t&lt;td&gt;\u0414\u043d\u0435\u043c&lt;\/td&gt; \t\t\t\t\t&lt;td&gt;\u0412\u0435\u0447\u0435\u0440\u043e\u043c&lt;\/td&gt; \t\t\t\t\t&lt;td&gt;\u041d\u043e\u0447\u044c\u044e&lt;\/td&gt; \t\t\t\t&lt;\/tr&gt; \t\t\t\t&lt;tr class=&quot;day-temp&quot;&gt; \t\t\t\t\t&lt;?php for($i = 0;$i &lt; 4;$i++): \/\/ \u0442.\u043a. \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 day_short \u0438 night_short, \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434 \u043d\u0430 4?&gt; \t\t\t\t\t&lt;td&gt;&lt;?php echo getTempSign($day-&gt;day_part[$i]-&gt;{'temperature-data'}-&gt;avg);?&gt; \u00b0C &lt;img src=&quot;&quot; width=&quot;48&quot; height=&quot;48&quot; \/&gt;&lt;\/td&gt;&lt;?php endfor;?&gt; \t\t\t\t&lt;\/tr&gt; \t\t\t\t&lt;tr class=&quot;day-param&quot;&gt; \t\t\t\t\t&lt;?php for($i = 0;$i &lt; 4;$i++): \/\/ \u0442.\u043a. \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 day_short \u0438 night_short, \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434 \u043d\u0430 4?&gt; \t\t\t\t\t&lt;td&gt; \t\t\t\t\t\t&lt;p&gt;&lt;strong&gt;&lt;?php echo $day-&gt;day_part[$i]-&gt;weather_type;?&gt;&lt;\/strong&gt;&lt;\/p&gt; \t\t\t\t\t\t&lt;p&gt;\u0432\u0435\u0442\u0435\u0440: &lt;?php echo getWindDirection($day-&gt;day_part[$i]-&gt;wind_direction).' '.$day-&gt;day_part[$i]-&gt;wind_speed;?&gt; \u043c\/\u0441&lt;\/p&gt; \t\t\t\t\t\t&lt;p&gt;\u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c: &lt;?php echo $day-&gt;day_part[$i]-&gt;humidity;?&gt;%&lt;\/p&gt; \t\t\t\t\t\t&lt;p&gt;\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435: &lt;?php echo $day-&gt;day_part[$i]-&gt;pressure;?&gt; \u043c\u043c \u0440\u0442. \u0441\u0442.&lt;\/p&gt; \t\t\t\t\t&lt;\/td&gt; \t\t\t\t\t&lt;?php endfor;?&gt; \t\t\t\t&lt;\/tr&gt; \t\t\t&lt;\/table&gt; \t\t&lt;\/div&gt;&lt;?php \tendforeach;?&gt; \t&lt;\/div&gt;&lt;?php endif; \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443 function getDayDate($date) { \t$date = strtotime($date); \t$months = array('','\u044f\u043d\u0432\u0430\u0440\u044f','\u0444\u0435\u0432\u0440\u0430\u043b\u044f','\u043c\u0430\u0440\u0442\u0430','\u0430\u043f\u0440\u0435\u043b\u044f','\u043c\u0430\u044f','\u0438\u044e\u043d\u044f','\u0438\u044e\u043b\u044f','\u0430\u0432\u0433\u0443\u0441\u0442\u0430','\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f','\u043e\u043a\u0442\u044f\u0431\u0440\u044f','\u043d\u043e\u044f\u0431\u0440\u044f','\u0434\u0435\u043a\u0430\u0431\u0440\u044f');     $days = array('\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435','\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a', '\u0432\u0442\u043e\u0440\u043d\u0438\u043a', '\u0441\u0440\u0435\u0434\u0430', '\u0447\u0435\u0442\u0432\u0435\u0440\u0433', '\u043f\u044f\u0442\u043d\u0438\u0446\u0430', '\u0441\u0443\u0431\u0431\u043e\u0442\u0430'); \treturn $days[date('w', $date)].', '.(int)date('d',$date).' '.$months[date('n', $date)]; } \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b function getTempSign($temp) { \t$temp = (int)$temp; \treturn $temp &gt; 0 ? '+'.$temp : $temp; } \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0442\u0440\u0430 function getWindDirection($wind) { \t$wind = (string)$wind; \t$wind_direction = array('s'=&gt;'&#8593; \u044e','n'=&gt;'&#8595; \u0441','w'=&gt;'&#8594; \u0437','e'=&gt;'&#8592; \u0432','sw'=&gt;'&#8599; \u044e\u0437','se'=&gt;'&#8598; \u044e\u0432','nw'=&gt;'&#8600; \u0441\u0437','ne'=&gt;'&#8601; \u0441\u0432'); \treturn $wind_direction[$wind]; } <\/code><\/pre>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 10 \u0434\u043d\u0435\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c \u0441\u0443\u0442\u043e\u043a, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438, \u043a\u0430\u043a \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430, \u0442\u0430\u043a \u0436\u0435 \u0431\u0435\u0440\u0435\u0442 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b <b>$day-&gt;day_part[$i]-&gt;{&#8216;temperature-data&#8217;}-&gt;avg<\/b>, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043e\u0434\u043d\u0443 \u0446\u0438\u0444\u0440\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445.<\/p>\n<h5>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0421 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430, \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435 \u0441\u0442\u0430\u043b, \u0438\u0445 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 xml-\u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u0434\u0430\u0447\u0438. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/233243\/\"> http:\/\/habrahabr.ru\/post\/233243\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u0442\u0430 \u043e \u043f\u043e\u0433\u043e\u0434\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/232529\/\">\u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445\u00bb<\/a>. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0435\u0449\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430, \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/396\/e51\/25e\/396e5125ecb34b8fbe3ad649695d13e7.jpg\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-233243","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233243"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233243\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}