Thread: URL to Match
View Single Post
Old 11-08-2007, 11:53 PM   #1 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default URL to Match

I want to match this:

Code:
<i>-- http://www.<b>google</b>.<b>com</b>/ &nbsp; <a href="http://dmoz.org/Computers/Internet/Searching/Search_Engines/Google/">Computers: Internet: Searching: Search Engines: Google</a></i>
Through the domain part: http://www.<b>google</b>.<b>com</b>/ and get back the following part:

Code:
<a href="http://dmoz.org/Computers/Internet/Searching/Search_Engines/Google/">Computers: Internet: Searching: Search Engines: Google</a>
Currently using the following in my function:

Where $szSiteName == 'google'

PHP Code:
            $szURLToMatch 'http:\/\/www.\<b\>'    .    $szSiteName    .    '\<\/b\>.\<b\>com\<\/b\>';
            
preg_match("/\<i\>-- $szURLToMatch\/ &nbsp; (.*?) \<\/i\>/"$szGetContents$aMatches); 
But the array returns no match.

Whole code: http://talkphp.pastebin.com/d10b3a5e3

Last edited by Haris : 11-09-2007 at 12:27 AM.
Haris is offline  
Reply With Quote