Question: I want to figure out if a number is in my array:

```
array(1) { [0]=> string(5) "3,4,5" } 

 if (in_array('3', $array)) {
      echo 'in array';
 } else {
     echo 'not in array';
 }

```

The result is `not in array` but I expect `in array`

Answer: 
You should try like this, with [explode](http://php.net/manual/en/function.explode.php) function 

```
<?php
$array = explode(",","3,4,5");

 if (in_array(3, $array)) {
      echo 'in array';
 } else {
     echo 'not in array';
 }
?>

```

Demo : <https://eval.in/932540>
You can create a function to move over all items in an array and check its content with the needle you want to find.

```
 function isInArray($array,$needle){
       foreach($array as $arrayItem){
          if(strpos($arrayItem,$needle)!==false)
             return true;
       }
       return false;
    }

```