PHP-функция: in_arrayСписок php-функций

javascript:

function in_array(needle, haystack, strict) {
	// Checks if a value exists in an array
	// 
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)

	var found = false, key, strict = !!strict;

	for (key in haystack) {
		if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
			found = true;
			break;
		}
	}

	return found;
}

//Примеры:

alert ( in_array('van', ['Kevin', 'van', 'Zonneveld']) );