← All built-ins / strncmp()
strncmp()
strncmp(...$args): int
Parameters
| Name | Type | Description |
|---|---|---|
| $a | string | first string |
| $b | string | second string |
| $n | int | maximum bytes to compare |
Return value
Like strcmp(), limited to the first $n bytes.
Example
echo strncmp("holyphp", "holyphp2", 7);0