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
  • Inversely escape an escaped string stripslashes

    stripslashes

    Inverselyescapeanesc
  • Alias ​​of strstr strchr

    strchr

    Alias​​ofstrstr
  • Use one string to split another string into an array explode

    explode

    Useonestringtosplita
  • Calculate a string of crc32 polynomials crc32

    crc32

    Calculateastringofcr
  • Remove spaces (or other characters) from the beginning and end of the string trim

    trim

    Removespaces(orother
  • Output formatted string printf

    printf

    Outputformattedstrin
  • Remove spaces (or other characters) from the beginning of the string ltrim

    ltrim

    Removespaces(orother
  • Convert special characters to HTML entities htmlspecialchars

    htmlspecialchars

    Convertspecialcharac
Popular Articles