Question: I am trying to validate Item No.s from user input. If the plus symbol is placed at the first place then the is\_numeric function does not gives error but on placing the + symbol anywhere else it gives the error.

**Case 1 :** 

```
$ItemNumber = '+123456789';

if(!is_numeric($ItemNumber))
{
   echo 'Sorry! Invalid Item No. given.';
}
else
{
  echo 'Success';
}

 //Output : Success

```

**Case 2 :** 

```
$ItemNumber = '123456789+';

if(!is_numeric($ItemNumber))
{
   echo 'Sorry! Invalid Item No. given.';
}
else
{
  echo 'Success';
}

//Output : Sorry! Invalid Item No. given.

```

Answer: 
`'+123456789'` is valid numeric string.Check the manual [is\_numeric](http://php.net/manual/en/function.is-numeric.php), but `'123456789+'` is not
Try this..

```
<?php
  $value = "+12345655539997";
  (or)
  $value = "+12345655539997+";
   (or)
   $value = "12345655539997+";

 if(!preg_match('/^[0-9+]+$/', $value) ) {
 echo 'Please enter a valid number';
 }else{
 echo "valid";
 }

```

Demo:<https://eval.in/470901>