Forum Moderators: coopster
So for just the URL only:
$contents = "some string with a <a ref="http://www.WebmasterWorld.com">WebmasterWorld</w>";
preg_match_all("/href=\"(.*?)\"/", $contents, $link_results);
How do you go about getting both the url and the WebmasterWorld and put them into an array so that if you wanted you could print_r the whole result set of there were more than one.
does that make sense, i hope so :)
I reckon this may have been covered before, but no joy as far as looking.
preg_match_all('#<a\s+href\s*=\s*[\'¦"]([^\'"]*)[\'"][^>]*>([^<]*)<#', $contents, $linkresults);
echo '<pre>'.htmlspecialchars(print_r($linkresults, TRUE)).'</pre>';