Mailinglisten-Archive |
Hi Valentin,
> Nimm preg_match(), das ist schneller! Dann muss er aber heißen
> preg_match("/<title>(.*)<\/title>/", $page_source, $title_tag);
> print($title_tag[0]);
oops,
so wird das aber nix !
Das hier wurde teilweise von Cyrill gepostet,
habe es dann auch gleich ausprobiert:
$fp = fopen($path.$file, "r");
$IN = fread($fp, filesize($path.$file));
$cl = fclose($fp);
preg_match('=<title(\s*)>(.+)</title(\s*)>=smi',$IN,$regs);
echo (isset($regs[2])) ? trim($regs[2]) : "leer";
Es ging damals um das gleiche Thema, mit der Erweiterung,
dass Zeilenumbrueche den Matsch nicht aushebeln koennen... ;-)
m. b. G. Norbert
_____________________
normal: 02292-681769
Notruf: 0177-2373368
---------------------
e.o.m.
php::bar PHP Wiki - Listenarchive