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
  • Alias ​​of rtrim chop

    chop

    Alias​​ofrtrim
  • Calculate the soundex key of a string soundex

    soundex

    Calculatethesoundexk
  • Translate characters or replace substrings - convert specified characters strtr

    strtr

    Translatecharacterso
  • Insert HTML newline tag before all new lines of a string nl2br

    nl2br

    InsertHTMLnewlinetag
  • Remove HTML and PHP tags from string strip_tags

    strip_tags

    RemoveHTMLandPHPtags
  • Randomly disrupt a string str_shuffle

    str_shuffle

    Randomlydisruptastri
  • Calculate the last occurrence of the specified string in the target string (case insensitive) strripos

    strripos

    Calculatethelastoccu
  • Output formatted string printf

    printf

    Outputformattedstrin