How to match value in multidimensional array?
Posted: Mon Apr 19, 2010 5:53 pm
Hi,
I can't seem to use in_array or array_search to match part of a string in my multidimensional array:
$array['cart]['key1'] = "Test string1 of 1"
['key2'] = "Test string2 of 2"
..
I want to search this array for "string2" and get the key associated with this value. Does anyone have a code for that DOES NOT use "foreach" or any other looping through array method?
Thanks!
I can't seem to use in_array or array_search to match part of a string in my multidimensional array:
$array['cart]['key1'] = "Test string1 of 1"
['key2'] = "Test string2 of 2"
..
I want to search this array for "string2" and get the key associated with this value. Does anyone have a code for that DOES NOT use "foreach" or any other looping through array method?
Thanks!