The array_key_exists function checks if the given key or index exists in the array and returns a boolean.

    
    $cars = array("Volvo"=>"XC90", "BMW"=>"X5");

    $carExists = array_key_exists("Volvo", $cars);

    echo $carExists;
    // 1