in_array (PHP-like)


/ Published in: JavaScript
Save to your folder(s)

like PHP function in_array


Copy this code and paste it in your HTML
  1. function in_array(item,arr) {
  2. for (p=0;p<arr.length;p++) if (item == arr[p]) return true;
  3. return false;
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.