<?php set_time_limit(3600); $url=array( '11723' => 'Брно', '11414' => 'Карловы Вары', '11418' => 'Марианские Лазни', '11448' => 'Пльзень', '11518' => 'Прага', '11790' => 'Черный Дул', '11412' => 'Яхимов' ); foreach( $url as $k=>$v ){ echo 'тип: '.$url[$k].'<br>'; $str=file_get_contents( 'http://weather.yandex.ru/' . $k . '/details/' ); preg_match( "'(<table class=\"b-forecast-details\">.+<\/table>)'is", $str, $ar ); if($k==11414){echo iconv( 'UTF-8', 'CP1251', $ar[1] );exit;} if ( isset( $ar[1] ) ) { echo 'загружаем...<br>'; $ar[1]=str_replace('http://img.yandex.net/i/weather/wind/','/images/weather/',$ar[1]); $ar[1]=str_replace('http://img.yandex.net/i/weather/moon/','/images/weather/',$ar[1]); if(file_put_contents( dirname( dirname( __FILE__ ) ) . '/weather/' . $k . '.html', iconv( 'UTF-8', 'CP1251', $ar[1] ) ))echo 'сохраняем...<br>'; } } ?>