Pro.Luv Posted October 14, 2008 Share Posted October 14, 2008 Hi, I need to get data from anchor tags on a page like <a href=[color=red]test.htm[/color]> [color=red]TEST PAGE[/color] </a> I need to get the data in red, If someone could show me this I would really appreciate it. Please help Thanks Link to comment https://forums.phpfreaks.com/topic/128340-anchor-tags/ Share on other sites More sharing options...
Daniel0 Posted October 14, 2008 Share Posted October 14, 2008 preg_match('#<a href=([^>]+)>([^<]+)</a>#i', $text, $matches); list(, $url, $label) = $matches; Something like this should do it. This requires your anchor tag to always look like the one displayed above though. Link to comment https://forums.phpfreaks.com/topic/128340-anchor-tags/#findComment-664826 Share on other sites More sharing options...
Pro.Luv Posted October 14, 2008 Author Share Posted October 14, 2008 Thanks Daniel0!! I really appreciate such a quick reply. Thanks again Link to comment https://forums.phpfreaks.com/topic/128340-anchor-tags/#findComment-664827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.