I've got this script to validate phone numbers. I want to allow numbers 0-9 and the characters -,(,) and + the following seems to only work if the input is all numbers and spaces. Suggestions?
if(!ereg("^[0-9\-\(\)\ \+]+$", $phoneNumber)||empty($phoneNumber)){
print'Please enter a valid phone number' ; $error++;
}