Posted By

jamierumbelow on 12/18/08


Tagged

search array key Value


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

brent-man
luman
vali29
joethermal


Search for a value in an array


 / Published in: PHP
 

  1. function array_value_exists($value, $array)
  2. {
  3. $array = array_flip($array);
  4.  
  5. return (array_key_exists($value, $array));
  6. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: youdontmeanmuch on December 21, 2008

Why not use in_array? *confused*

You need to login to post a comment.