remp
11-22-2010, 03:40 AM
Hello everyone, i have a contact form which has a phone number field, and i want to make it only number,
i have used the following code:
if (preg_match('/^[0-9]{1,}$/', $phone) < 4 ) {
$error['phone'] = "Please enter your phone number.";
}
But for some reason, it does not work, can you give me a hand with this?
i have used the following code:
if (preg_match('/^[0-9]{1,}$/', $phone) < 4 ) {
$error['phone'] = "Please enter your phone number.";
}
But for some reason, it does not work, can you give me a hand with this?