var arr = [ "mysql", "php", "css", "js" ]; $.inArray("php", arr); //返回 1,如果不包含在数组中,则返回 -1; 转载于:https://www.cnblogs.com/myphper/p/4113247.html