sourceforge.net/projects/simplehtmldom/ ver 1.5
This script work under windows 7, do not work under linux
<?php
require_once('simple_html_dom.php');
$sUrl = 'http://baby.ru/';
$oParser = str_get_html(file_get_contents($sUrl));
// this work everywhere
foreach($oParser->find('title') as $oElement) {
echo $oElement->plaintext."
";
}
// this work only under windows 7, not work on server under linux
foreach($oParser->find('img') as $oElement) {
echo $oElement->src."
";
}
Windows output (title + img)
- бэби.ру: беременность, календарь беременности, беременность по неделям
- http://www.tns-counter.ru/V13a**baby_ru/ru/CP1251/tmsec=baby_total/
- http://www.baby.ru/pic/top_menu/logo2.png
- /i/partners/plantex/2013/pridanoe/kroxa.png
- /i/partners/pampers/assistants2.gif
- ...
Linux output (only title tag)
- бэби.ру: беременность, календарь беременности, беременность по неделям
PHP produce no error.
As you see "title" tag work everywhere. What happen with "img" tag?
What may be wrong on my server?