Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP strcoll() Function

PHP strcoll() Function

PHP String Reference Manual PHP String Reference Manual

Example

Compare strings:

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

Run Example »


Definition and Usage

The strcoll() function compares two strings.

The comparison of strings varies according to the locale setting (Aa).

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

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


Syntax

strcoll(

string1,string2

)

Parameters Description
string1 Required. Specifies the first string to compare.
string2 Required. Specifies the second string to compare.

Technical Details

| Return value: | This function returns:

| | --- | --- | | PHP version: | 4.0.5+ | | Changelog: | Since PHP 4.2.3, this function works on win32. |

PHP String Reference Manual PHP String Reference Manual