We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

glex on 01/15/08


Tagged

array in


Versions (?)


in_array()


Published in: JavaScript 


PHP in_array() function in JavaScript

  1. function in_array( what, where ){
  2. var a=false;
  3. for(var i=0;i<where.length;i++){
  4. if(what == where[i]){
  5. a=true;
  6. break;
  7. }
  8. }
  9. return a;
  10. }

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: matasoy on November 22, 2008

Thank you very much i have been looking for this code for an hour good works

Posted By: matasoy on November 22, 2008

These codes are looking for the suitable extension of an uploading file

function in_array( what, where ){ var a=false; for(var i=0;i

You need to login to post a comment.