Iam New in PHP . I Know How to Check a String number or Not using is_numeric
but I want Check Mobile Number add +
in my case
$mobile = "+15666886345" ;
if($mobile) {
// Valid Mobile Number
}
else {
// Not Valid Mobile Number
}
How to Check this Case
You can use php preg_match() function to match the string as like below
if(!preg_match('/^[0-9 +-]*$/', $mobile)){
// Valid Mobile Number
}else{
// Not Valid Mobile Number
}