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 can use [strpos()](http://php.net/manual/en/function.strpos.php) [***in case of current scenario only***]

```
if (strpos($array[0],'3') !==false) {
      echo 'in array';
 } else {
     echo 'not in array';
 }

```

Output:- <https://eval.in/932541>

Or you can use [explode()](http://php.net/manual/en/function.explode.php)
 [***for multiple scenario***]

```
$array = [0=>"3,4,5"];

$array = explode(',',$array[0]);

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

```

Output:- <https://eval.in/932542> Or <https://eval.in/932545>
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>