I have below multi-dimension session array to store cart items, I want to search whether the price in the cart list are contain price with 0.00
, if yes, I want it to return true and do URL redirection.
Array
(
[0] => Array
(
[p_name] => Product 01
[p_id] => 123
[p_price] => 0.00
[p_alt-variation-1] => Blue
[p_alt-variation-2] => L
[p_qty] => 1
)
[1] => Array
(
[p_name] => Product 02
[p_id] => 124
[p_price] => 13.00
[p_qty] => 1
)
[2] => Array
(
[p_name] => Product 03
[p_id] => 125
[p_price] => 99.00
[p_qty] => 2
)
)
I've try :
$key = array_search(0.00, array_column($_SESSION['products'], 'p_price'));
echo $key;
if($key === true){
//redirect url
}
it end up displayed 0
, what does it means?