Hallo Jeena.
Wenn du die Seite als String in einer Variable $html_source hast, dann klappt das mit diesem Regex:
preg_match('|<title>([^<]*?)</title>|is', $html_source, $title);
Hm, warum eigentlich gleich mit regulären Ausdrücken losfeuern?
So kann es auch gehen:
<?php
$str_html = '<html><head><title>Foo</title></head><body><p>Bar</p></body>'; // Simples HTML-Dokument
$int_start = strpos($str_html, '<title>'); // Position des title-Anfangstags
$int_start += 7; // strlen('<title>') == 7
$int_end = strpos($str_html, '</', $int_start); // Position des title-Endtags
echo substr($str_html, $int_start, $int_end - $int_start); // „Foo“
?>
Einen schönen Sonntag noch.
Gruß, Ashura
--
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]