Skip to content
Advertisement

How to check if string is in array with php?

I have an array that looks like the following when var_dump:

JavaScript

I need to echo a value if the array does not contain the following string: ‘hello’

How is this possible, I have tried using in_array, but unsuccessfully. Help appreciated.

Advertisement

Answer

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