You are here: Re: Extract any URL from any string? « PHP Programming Language « IT news, forums, messages
Re: Extract any URL from any string?

Posted by deko on 02/11/07 09:07

http://www.liarsscourge.com <<== the script is here


"deko" <deko@nospam.com> wrote in message
news:5KmdnX5BcquHR1PYnZ2dnUVZ_tKjnZ2d@comcast.com...
> geturl 2.0...
>
>> 1. Increase the error_reporting level and you will find some sloppy notices
>
> so I have a few undefined variables... I thought this did not matter with PHP
> (script vs. compiled code)
>
>> 2. Have a look at parse_url(), which might be useful
>
> well, if urlString = http://netforex.subdomain.net.foo'>, parse_url()
> returns: netforex.subdomain.net.foo'> - which is not much help. Nevertheless,
> I'm using it on line 79 for validation - but I think it would be better
> validation if I could do this:
> if ($urlLink = parse_url($urlLink))
> {
> return $urlLink['host'];
> }
> ??
>
>> 3. Use preg_* functions instead of POSIX ereg* function (performance)
>
> I was able to replace an eregi with preg_match on lines 18 and 29, but unsure
> of the syntax for line 44 ... suggestions?
>
>> 4. Strings like the following cause infinite loops:
>>
>> getURL('fofo http://discovery.co.uk/../foo');
>
> fixed! see line 38.
>
> - - - - -
>
> I'm wondering how much of a hack that for loop is (lines 26 - 53). Seems to
> work okay...
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация