I have an array that looks like this:
Array
(
[0] => Array
(
[Product] => Amazing Widget
[Value] => 200
)
[1] => Array
(
[Product] => Super Amazing Widget
[Value] => 400
)
[2] => Array
(
[Product] => Promising Widget
[Value] => 300
)
[3] => Array
(
[Product] => Superb Widget
[Value] => 400
)
)
I believe it's a nested Multi-dimensional array.
Anyway I'm trying to detect if a Product Name Already exists in the array. This is what I'm trying to do
if('Super Amazing Widget' is in the array) {
echo 'In the Array';
}
I've tried this:
if(in_array('Super Amazing Widget', $array)){
echo 'In The Array';
}
But it's not working and I can't find out why.
EDIT:
Some of the Functions in here worked really well: in_array() and multidimensional array