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: 
```
<?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';
         }
    }

?>

```
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';
    }

```