I have an array, $data, that looks like this when printed:
[1] => Array
[type] => link
[2] => Array
[type] => photo
[3] => Array
[type] => video
I have a foreach statement for the $data, so each $data holds a [type] key. I need to be able to check if the [type] key has a value of ‘link’, else a value of ‘photo’, else a value of ‘video’.
Any help would be great. I tried array_key_exists, but that is just to check if a key is present in the data string.
1 Answer