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 01:50

> 1. Increase the error_reporting level and you will find some sloppy notices
> 2. Have a look at parse_url(), which might be useful
> 3. Use preg_* functions instead of POSIX ereg* function (performance)
> 4. Strings like the following cause infinite loops:
>
> getURL('fofo http://discovery.co.uk/../foo');
>
> Probable fix:
>
> = Replace:
>
> if (!eregi("^(com|net|org...)$", $urlString_a[$i])) {
> ...
> }
>
> = With:
>
> if (preg_match("!^(com|net|org...)[^$]!", $urlString_a[$i], $m)) {
> $urlString_a[$i] = $m[1];
> }

Outstanding. Thanks for the constructive feedback.

 

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

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