← All built-ins / glob()

glob()

glob(string $s): mixed

Parameters

NameTypeDescription
$patternstringwildcard pattern like "*.hphp"

Return value

Matching paths as an array (empty when nothing matches).

Example

$f = glob("tests/positive/*.hphp");
echo count($f) >= 5 ? "found-tests" : "none";
found-tests

See also

scandir()is_file()