Mailinglisten-Archive |
Hallo Ulrich ,
Thursday, February 28, 2002, 1:00:47 PM, you wrote:
UH> Hallo,
UH> ich möchte einen Link auseinandernehmen, z.B. <a
UH> href="http://www.domain.com/page.html">Click</a>, so dass ich hinter zwei
UH> Variablen habe: $href = "http://www.domain.com/page.html" und $headline =
UH> "Click"
UH> Mit einem regulären Ausdruck bin ich wohl auf der sicheren Seite - kann mir
UH> jemand helfen? Dank im vorraus.
UH> Gruß, Uli
function findLink($text)
{
$total = "/<a href\=\'(.*)\'>(.*)<\/a>/";
if (preg_match($total,$text,$matches)) :
return $matches;
else :
die("Nothing");
endif;
}
$matches[0]: $text
$matches[1]: href // dein $href
$matches[3]: description // dein $headline
Gruss Stefan
php::bar PHP Wiki - Listenarchive