liam_d The original NP Emo KidEstablished Member ★ 20 ★ Impact 25 Jun 18, 2008 1K views 1 reply #1 Hi all i need a good way to strip html hyperlink code from a link and just display the actual address, anyone got a good code to do it? Thanks!
Hi all i need a good way to strip html hyperlink code from a link and just display the actual address, anyone got a good code to do it? Thanks!
B Bruce_KD Established Member ★ 15 ★ Impact 14 Jun 18, 2008 #2 Some Regular Expression fun. Its in php currently, but the pattern should be consistent across most languages. Code: $string="<a href='http://www.google.com'>Google</a> is a search engine.\n <br />"; preg_match("/\<a href\='([^']+)'\>([^\<]+)\<\/a\>/", $string, $matches); echo $matches[1]; Bruce
Some Regular Expression fun. Its in php currently, but the pattern should be consistent across most languages. Code: $string="<a href='http://www.google.com'>Google</a> is a search engine.\n <br />"; preg_match("/\<a href\='([^']+)'\>([^\<]+)\<\/a\>/", $string, $matches); echo $matches[1]; Bruce