Jump to content

[SOLVED] How do I make sure a string is [:alnum:]


sardonicgem

Recommended Posts

The form field is case sensitive. Also I'm not quite sure how preg_match works.

 

php.net indicates:

 

preg_match() returns the number of times pattern  matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match.

 

So suppose my string was "Pa55word"

 

preg_match( '[:alnum:]',"Pa55word")

 

So according to the return value conditions, will preg_match stop searching after P?

Thanx for the response teng84 but I'm not quite sure I understand what you're talking about.  In my case above will preg_match stop searching after the letter P?  If so,  is there a function that you know of that can search all characters of the input string and confirm that they are all [:alnum:]?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.