Reply to Re: URL character check

Your name:

Reply:


Posted by jamen on 12/10/05 01:38

hendry wrote:
> I am looking for a function that checks there isn't non-valid URL
> characters in some input:
>
> http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
>
> if (preg_match("/[^a-zA-Z0-9$-_.+!*'(),]/", $uri))

Remember that in a character class the hypen (-) character has a very
special meaning. So escape it, or move it to the front or back of the class:

$-_

Means all the characters between $ and _ including $ and _

And escape the $-character to be sure php doesn't try to parse it as a
variable

/[^a-zA-Z0-9\$_.+!*'(),-]/

[Back to original 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

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