: | Javascript Index | : | PHP | : | MySQL | : |
: | Source | : | : | Explanation | : | : | Example | : | : | Todo | : | : | Feedback | : |
check whether a certain value exists in an array
Added: 2006-04-28 08:35:34
/****** * You may use and/or modify this script as long as you: * 1. Keep my name & webpage mentioned * 2. Don't use it for commercial purposes * * If you want to use this script without complying to the rules above, please contact me first at: marty@excudo.net * * Author: Martijn Korse * Website: http://devshed.excudo.net * * Date: 2006-04-28 08:35:34 ***/ function inArray(needle, haystack) { for (var i in haystack) { if (needle == haystack[i]) return true; } }