Posted By

glex on 01/15/08


array in

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite



 / 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  


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.