if there's only one link you want to extract use:
preg_match("!(href=\")(.*?)(\")!",
$link, $matches);
$host = $matches[2];
echo $host;
otherwise use this:
preg_match_all("!(href=\")(.*?)(\")!",
$link, $matches);
for ($i=0; $i< count($matches[2]); $i++) {
$host = $matches[2][$i];
echo $host;
}
keep in mind that this extract everything between the - href" - and the second - " - .
If you just want to extract the links for - leftmenu - change the - href=\" - to:
<a class=\"leftmenu\" href=\"
That works.