php ini_set display_errors true error_reporting E_ALL include libs cur

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
include 'libs/curl/pi_curl_exception.php';
include 'libs/curl/pi_curl.php';
$cURL = new Pi_Curl;
$cURL->setDefaultOptions();
$cURL->setOption('URL', 'http://pogoda.mail.ru/');
$cURL->setOption('TIMEOUT', 10);
$cURL->applyOptions();
$result = curl_exec($cURL->getHandle());
$pattern = "~<td valign=\"middle\" nowrap>(.*)</td>~Uis";
preg_match($pattern, $result, $matches);
$result = strip_tags($matches[1]);
$result = explode("\n", $result);
print_r($result);