I'm trying to use array_search to find the key of a value in an array, I have the following simple code:
$current_user_existing_shopping_bag_string = '1446784/-/3/-/£797.00(_)902982/-/4/-/£148.80(_) ';
$current_user_existing_shopping_bag_array = explode('(_)', $current_user_existing_shopping_bag_string);
$key = array_search($current_user_existing_shopping_bag_array, '902982');
echo $key;
However I have no idea why this doesn't return the key of the value in the array, it should though. I've been trying various solutions for hours now and still no luck.
Anybody able to give me a pointer why this doesn't return the key for the value in the array?
Thanks