Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regular expression
#1
how can we write regular expression in php and validate text fields. can anyone help me.
Reply
#2
DO you have any code of it?
Reply
#3
actually, i want to validate my firstname text field which php. i want to make sure that the user must write only alphabet in the text field.
Reply
#4
DO you have Grip on HTML? i guess you can do this on it.
Reply
#5
$username = "Muhammad Ali2";

if (preg_match('#[0-9]#',$username)){

echo 'Error Invalid Username Contain a Number';
}else{
echo 'This is a valid Username';
}
Reply
#6
Thanks, let me try.........
Reply
#7
Kamran its my fellow he done MIT from Vu.
Reply
#8
itgenuis Wrote:$username = "Muhammad Ali2";

if (preg_match('#[0-9]#',$username)){

echo 'Error Invalid Username Contain a Number';
}else{
echo 'This is a valid Username';
}

Thanks itgenuis
Reply
#9
Soon a Php and my sql urdu lectures will be uploaded to our website.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)