Skip to content
Advertisement

How to get the value that is in the array instead of true with in_array?

How could I receive the return with the value that is inside the array, and not true? in_array() does this?

JavaScript

Advertisement

Answer

You could search for it, that returns the key and use that key to access it:

JavaScript

Or if $type is found you can just access it:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement