← All docs

fnmatch()

Matches a filename against a pattern.

fnmatch()

function fnmatch(string $pattern, string $filename, int $flags = 0): bool

Matches a filename against a pattern.

Parameters:

  • $pattern (string)
  • $filename (string)
  • $flags (int), default 0, optional

Returns: bool

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how fnmatch is implemented in the compiler, see the internals page.