Question: Following is my code here actually o/p should be hi..but it is giving no 

```
<?php

    $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    $c='xyz,ccc';

    if(in_array(isset($c) && $c,$arr))
    {
        echo 'hi';
    }
    else 
    {
        echo 'no';
    }

?>

```

output:hi

actual result should be 'no'.

Answer: 
Side note, this is bad code:

```
in_array(isset($weekendArr) && $weekendArr,$arr)

```

do it like

```
isset($weekendArr) && in_array($weekendArr,$arr)

```

and in\_array is not strict so this 

```
in_array(true,array('w','s'))

```

will be allways TRUE

do it with:

```
in_array(true,array('w','s'),true)

```

and you see.

And you can't check an array with an array the $needle be an STRING here.
The only solution is to do splitt your STRING into two values and then check two times for TRUE

```
$c='Sunday,Monday';
foreach(explode(',',$c) as $check){
  if(in_array($c,$arr,true))
  {
    echo $check.' is in array';
  }
  else 
  {
    echo $check.' is NOT in array';
  }
}

```

Hope that helps a little.
Change your code to:

```
<?php

    $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    $c='Sunday,Monday';

    if(in_array(isset($c) && $c,$arr))
    {
        echo 'hi';
    }
    else 
    {
        echo 'no';
    }

```