Jump to content

Would this match letters only no matter case?


aeroswat

Recommended Posts

sure, that would work, though opposite of what you're asking.  If it finds anything that is not a-z or A-Z it will return true.  So true means the string has more than just letters, false means that it IS only a-z or A-Z

 

if you want to have it return true if the string is only case insensitive letters, you would need to do this:

 

preg_match("/^[a-z]+$/i',$str);

 

 

sure, that would work, though opposite of what you're asking.  If it finds anything that is not a-z or A-Z it will return true.  So true means the string has more than just letters, false means that it IS only a-z or A-Z

 

if you want to have it return true if the string is only case insensitive letters, you would need to do this:

 

preg_match("/^[a-z]+$/i',$str);

 

I got it to do what I needed it to do without even full knowing what I needed it to do lol ;)

It worked the way I wanted it to the way I wrote it. Thankyou for the help and explanation :)

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.