PHP strcoll() Function

Definition

The strcoll() function compares two strings.

Syntax

PHP strcoll() Function has the following syntax.

strcoll(string1,string2)

Parameter

ParameterIsRequired Description
string1Required. First string to compare
string2Required. Second string to compare

Return

This function returns:

  • 0 - if the two strings are equal
  • <0 - if string1 is less than string2
  • >0 - if string1 is greater than string2

Note

The comparison of the strings may vary depending on the locale settings (A<a or A>a).

The strcoll() is case-sensitive but not binary-safe.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions