title: Check if an array contains a specific value?
body: <p>I'd like to check if there is a value on an array like this:</p>
  
  <pre><code>function check_value_new ($list, $message) {
      foreach ($list as $current) {
          if ($current == $message) return true;
      }
      return false;
  }
  
  function check_value_old ($list, $message) {
      for ($i = 0; $i &lt; count ($status_list); $i ++) {
          if ($status_list[$i] == $$message) return true;
      }
      return false;
  }
  
  $arr = array ("hello", "good bye", "ciao", "buenas dias", "bon jour");
  check_value_old ($arr, "buenas dias"); // works but it isn't the best
  check_value_new ($arr, "buenas dias"); // argument error, where I'm wrong?
  </code></pre>
  
  <p>I've read the <code>check_value_new</code> method is a better way to work with arrays, but I'm not used to work with it, how I should fix it?</p>