How can I grab the identifier in an array?
Like this example
Array
(
[6] => Stil
[8] => Färg
[7] => Material
)
I want to fetch the 6, 8 and 7. To fetch “Stil”, “Färg” and “Material” it is pretty easy. $arr[6] and so on. But if I want to get or see if the 6, 8 or 7 exists. How do I manage this?
Use
array_search.Or if the value is the array multiple times, use
array_keys.UPDATE: If you don’t know the value, you can use
array_key_exists: