Method glob()

Method glob

bool glob(string glob, string str)
string glob(array(string) glob, string str)
array(string) glob(string glob, array(string) str)
array(string) glob(array(string) glob, array(string) str)


Match strings against a glob pattern.

Parameter glob

The glob pattern. A question sign ('?') matches any character and an asterisk ('*') matches a string of arbitrary length. All other characters only match themselves.


the function returns the matching glob if any of the given patterns match. Otherwise 0. If the second argument is an array it will behave as if the first argument is a string (see below)

Parameter str

1 is returned if the string str matches glob, 0 (zero) otherwise.


All strings in the array str are matched against glob, and those that match are returned in an array (in the same order).

See also

sscanf(), Regexp