Code Snippets → PHP → PHP Array Contains PHP Array Contains Chris Coyier on Sep 13, 2009 Check if value is in array and outputs Yes or No <?php $names = array( 'Bob', 'Jim', 'Mark' ); echo 'In Array? '; if (in_array(‘foo’, $names)) echo 'Yes'; else echo 'No'; ?>
Nice! Exactly what I was looking for.
I found it helpful.
Tks man! I was looking for it!
Had an AHA moment when i tried this out for a project i was working on
Thanks, you saved me some work
So simple :) Thanks!
Thanks a bunch! Much better solution than I would have done otherwise.