Definition
The strcoll() function compares two strings. The comparison of the strings may vary depending on the locale settings (A<a
or A>a
). This function is case-sensitive but not binary-safe.
Syntax
strcoll(string1, string2)
Parameters
Parameter | Description |
---|---|
string1 |
Required. Specifies the first string to compare. |
string2 |
Required. Specifies the second string to compare. |
Example
<?php
setlocale (LC_COLLATE, 'en_US');
echo strcoll("Welcome to PHP!","welcome to php!");