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.
```
<?php
    $listDays=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    $day='Sunday'; //You cant test both days ! Just one value at a time

    if(true === in_array($day, $listDays))
    {
        echo 'hi';
    }
    else 
    {
        echo 'no';
    }

?>

```

Or option two if you want to test different days

```
<?php
    $listDays=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    $dayToTest='Sunday, Monday'; //Here we have multiple days

    $tabTest = preg_split(',', $day); //split into an array

    //Then test for each string in tabTest
    foreach($tabTest as $string)
    {
         if(true === in_array($string, $listDays))
         {
            echo $string.' is OK';
         }
         else 
         {
            echo 'no';
         }
    }

?>

```