Showing posts with label in_array(). Show all posts
Showing posts with label in_array(). Show all posts

PHP : Check if an array contains any value in a set

In this tutorial Learn How to Check if an array contains any value in a set in php using in_array() method


function array_contains_any_val(array $array, array $subset, bool $strict = false) :bool
{
    $contains = false;
    foreach ($subset as $value) {
        if (in_array($value, $array, $strict)) {
            $contains = true;
            break;
        }
    }
    return $contains;
}

PHP : Check if an item is in an array

In this tutorial learn how to Check if an item is in an array or not in array using in_array() method

function contains($array, $value)
    {
        return in_array($value, $array, true);
    }


how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...