I have an array with the following setup:
array(
array(
'product_id' => 733
),
array(
'product_name' => Example
)
)
I want to check that 733 exists in my array which I need to use array_search (going by googling) as in_array doesn't work on m-d arrays.
My code is:
$key = array_search( '733', array_column( $items, 'product_id' ) );
If I var_dump the $items array I can see the product_id
I want to check the specific ID exists in the array and then perform other code.
array_valuesfunction w3schools.com/php/func_array_values.asp