Possible Duplicate:
Grabbing the href attribute of an A element
Parse All Links That Contain A Specific Word In "href" Tag
I'm using the following function to add _blank to all the links on my website.
function targetBlank($text) {
$return = str_replace('<a', '<a target="_blank"', $text);
return $return;
}
I'm looking for a solution to apply this function only on external links (not on my domain) instead of all links.