← All docs

strncmp()

Compares the first n bytes of two strings.

strncmp()

function strncmp(string $string1, string $string2, int $length): int

Compares the first n bytes of two strings.

Parameters:

  • $string1 (string)
  • $string2 (string)
  • $length (int)

Returns: int

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

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