pike.hubbe.net

[Top]
previoushas_suffix() indices()next

Method has_value()


Method has_value

int has_value(string haystack, string value)
int has_value(string haystack, int value)
int has_value(array haystack, int value)
int has_value(mapping haystack, mixed value)

Description

Search for value in haystack.

Returns

Returns 1 if value is in the value domain of haystack, or 0 (zero) if not found.

This function is in all cases except when both arguments are strings equivalent to (but sometimes faster than):

search(values(haystack), value) != -1

If both arguments are strings, has_value is equivalent to:

search(haystack, value) != -1

See also

has_index, indices, search, values, zero_type


Extracted from Pike v7.3 release 11 at 2001-11-03.