I have a $_SESSION['basket']
containing multiple arrays. I want to check if this $_SESSION['basket']
variable contains a specific array and that they have the same values.
For example, I want to check that $my_array
which is an array is the same as $_SESSION['basket'][i]
.
$_SESSION['basket']
would contain multiple arrays as follow :
$_SESSION['basket'] = array(
[0] => array(
"key1" => "value1",
"key2" => "value2"
);
[1] => array(
"key3" => "value3",
"key4" => "value4"
);
[2] => array(
"key5" => "value5",
"key6" => "value6"
);
);
And $my_array
would contain :
array(
"key3" => "value3",
"key4" => "value4"
);
So I want to make sure that the $my_array
variable is contained inside the $_SESSION['basket']
variable and it's values are exactly the same obviously. Is there a way to do that without having to use a loop? If not, how to do it with a loop nonetheless?