foreach($html->find('img') as $img) {
echo "Адрес страницы: " . $img->src . "\n";
echo "Название: " . $img->title . "\n";
echo "Описание: " . $img->alt . "\n";
}
$date = time();
var_dump(date('c', $date));
# string '2015-10-26T14:42:19+03:00' (length=25)
$m10m = strtotime('-10 minutes', $date);
var_dump(date('c', $m10m));
# string '2015-10-26T14:32:19+03:00' (length=25)
$m50m = strtotime('-50 minutes', $date);
var_dump(date('c', $m50m));
# string '2015-10-26T13:52:19+03:00' (length=25)
$date1 = new DateTime();
$date2 = clone($date1);
$i1 = new DateInterval('PT10M');
$i2 = new DateInterval('PT50M');
var_dump($date1->format('c'));
# string '2015-10-26T14:49:27+03:00' (length=25)
var_dump($date1->sub($i1)->format('c'));
# string '2015-10-26T14:39:27+03:00' (length=25)
var_dump($date2->sub($i2)->format('c'));
# string '2015-10-26T13:59:27+03:00' (length=25)
<?php
if ($_SERVER['SERVER_NAME'] === '43346.домен.ru') {
echo '<meta name="robots">';
}
$html = file_get_html('www.hltv.org/hltv.rss.php');
foreach($html->find('item') as $element)
$title = $element->find('title', 0)->plaintext;
$link = $element->find('link', 0)->plaintext;
$description = $element->find('description' , 0)->plaintext;
$pubDate = $element->find('pubDate', 0)->plaintext;
}