Definition
The strncasecmp() function compares(binary-safe and case-insensitive) two strings.
Syntax
strncasecmp(string1, string2, length)
Parameters
Parameter | Description |
---|---|
string1 |
Required. Specifies the first string to compare. |
string2 |
Required. Specifies the second string to compare. |
length |
Required. Specify the number of characters from each string to be used in the comparison. |
Example
<?php
echo strncasecmp("Welcome to PHP!","welcome to Php!", 7);