PHP: <?php $curl = new curl('http://ya.ru/'); $curl->returntransfer = true; $curl->range = '2308-2330'; $kusokIneta = $curl->exec(); echo $kusokIneta; class curl { private $ch; function __construct($url = null) { $this->ch = curl_init($url); } function __set($var, $value) { $name = 'CURLOPT_'.strtoupper($var); $key = constant($name); curl_setopt($this->ch, $key, $value); } function __call($var, $params) { $functionName = 'curl_'.strtolower($var); array_unshift($params, $this->ch); return call_user_func_array($functionName, $params); } } ?>
http://php.ru/manual/function.file-get-contents.html http://php.ru/manual/function.preg-match.html Код (Text): <?php $url = "http://pda.weather.yandex.ru/index.xml?city_id=26850"; $unique_start = "<nobr>"; $unique_end = "</nobr>"; function weather($url, $unique_start, $unique_end) { $code = file_get_contents($url); preg_match('/'.preg_quote($unique_start, '/').'(.*)'.preg_quote($unique_end, '/').'/Us', $code, $match); return $match[1]; } echo weather($url, $unique_start, $unique_end); ?>