Reputation: 5298
I'm in the process of rewriting a Perl-based web crawler I wrote nearly 8 years ago in PHP. I used the quite handy URI::URL module in perl to do things like:
$sourceUrl = '/blah.html';
$baseHost = 'http://www.example.com';
my $url = URI::URL->new($sourceUrl, $baseHost);
return $url->abs;
returns: 'http://www.example.com/blah.html'
the parse_url function in PHP is quite handy, but is there something more robust? Specifically something that will give the above functionality?
Upvotes: 1
Views: 433
Reputation: 9159
I did a bit of searching on the PEAR archive, and my first-guess approximation of URI::URL is Net_URL2. Maybe you want to give that a shot?
Upvotes: 0
Reputation: 180023
print $baseHost . $sourceURL;
Am I missing something? Your way seems needlessly overcomplicated.
Upvotes: 0