Current Location: Home> Function Categories> strcoll

strcoll

Comparison of strings based on locale settings
Name:strcoll
Category:String
Programming Language:php
One-line Description:Compare two strings (according to local settings).

Definition and usage

strcoll() function compares two strings.

Comparison of strings varies according to local settings (A<a or A>a).

Note: strcoll() is case sensitive, but not binary safe.

Note: If the current local setting is C or POSIX, the function works the same way as strcmp() .

Example

Compare strings:

 <?php
setlocale ( LC_COLLATE , 'NL' ) ;
echo strcoll ( "Hello World!" , "Hello World!" ) ;
echo "<br>" ;

setlocale ( LC_COLLATE , 'en_US' ) ;
echo strcoll ( "Hello World!" , "Hello World!" ) ;
?>

Try it yourself

grammar

 strcoll ( string1 , string2 )
parameter describe
string1 Required. Specifies the first string to be compared.
string2 Required. Specifies the second string to be compared.
Similar Functions
Popular Articles