Search for a value in an array


/ Published in: PHP



Copy this code and paste it in your HTML
  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

You need to login to post a comment.