HTML Utilities

Showing help on 'is_member()'

Syntax: is_member (ANY value, LIST list, INT case-sensitive) => INT

Returns the index of <value> if there is an element of <list> that is completely indistinguishable from <value>. This is much the same operation as "<value> in <list>" except that, unlike `in', the `is_member()' function does not treat upper- and lower-case characters in strings as equal. This treatment of strings can be controlled with the <case-sensitive> argument; setting <case-sensitive> to false will effectively disable this behavior.

Raises E_ARGS if two values are given or if more than three arguments are given. Raises E_TYPE if the second argument is not a list. Otherwise returns the index of <value> in <list>, or 0 if it's not in there.

is_member(3, {3, 10, 11}) => 1
is_member("a", {"A", "B", "C"}) => 0
is_member("XyZ", {"XYZ", "xyz", "XyZ"}) => 3
is_member("def", {"ABC", "DEF", "GHI"}, 0) => 2



-- telnet://project-mongoose.net:7777 -- Mail us -- http://project-mongoose.net:7780/ --
-- Five users connected --