Jump to content

check atleast one number and one letter in php string


Nandini

Recommended Posts

Hi

 

I want to check atleast one number and one letter in php string using regular expressions. I am using the followinf snippet. But thats not working me fine. Please help me. here is my code

 

$reg="/^[a-z0-9]{1,}$/";
if(preg_match($reg, $_POST['string']))
{
$e="String should be atleast one letter and one number";
}

 

pls help me out.

 

Thanq

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.