[advanced search]
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-18-2008, 03:29 AM   · #1
liam_d
The original NP Emo Kid
 
liam_d's Avatar
 
Name: Liam Dawe
Location: Plymouth, UK
Trader Rating: (28)
Join Date: Jan 2005
Posts: 1,561
NP$: 93.00 (Donate)
liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
[PHP] strip "a href" html code from links

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!


Please register or log-in into NamePros to hide ads
liam_d is offline   Reply With Quote
Old 06-18-2008, 05:44 AM   · #2
Bruce_KD
NamePros Member
 
Trader Rating: (1)
Join Date: Sep 2006
Posts: 78
NP$: 100.00 (Donate)
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
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
Bruce_KD is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Traffic Down Under http://www.mobisitetrader.com/ Buy Flash Arcade Game Script
Advertise your business at NamePros
All times are GMT -7. The time now is 06:00 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0