Reply
Finding URLs in a PHP String
Old 05-11-2008, 12:33 AM Finding URLs in a PHP String
Novice Talker

Posts: 12
I'm looking for a way to work out the number of urls within a PHP string for example


PHP Code:
Please find my website at <a href="mydomain1.com">My Domain</a> and <a href="mydomain2.com">My Domain 2</a>

Would return that there was two urls included within the php string, I've thought of using substr_count but I cant see anyway of making that work.

Can anyone offer any help

Thanks
feelice is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-11-2008, 02:37 AM Re: Finding URLs in a PHP String
addonchat's Avatar
Skilled Talker

Posts: 97
Name: Chris Duerr
You've made quite a few of posts concerning parsing/matching data. I suggest doing some research on regular expressions. Here are some references for you:

http://www.webcheatsheet.com/php/reg...xpressions.php
http://www.regular-expressions.info/
http://www.regular-expressions.info/php.html
http://us3.php.net/manual/en/book.pcre.php
http://us3.php.net/manual/en/book.regex.php
__________________
Chris Duerr
AddonChat Java Chat Software
http://www.addonchat.com/ - Affiliate Program
addonchat is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Finding URLs in a PHP String
 

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11613 seconds with 13 queries