W3cubDocs

/Drupal 8

public static function Unicode::strcasecmp

public static Unicode::strcasecmp($str1, $str2)

Compares UTF-8-encoded strings in a binary safe case-insensitive manner.

Parameters

string $str1: The first string.

string $str2: The second string.

Return value

int Returns < 0 if $str1 is less than $str2; > 0 if $str1 is greater than $str2, and 0 if they are equal.

File

core/lib/Drupal/Component/Utility/Unicode.php, line 583

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

public static function strcasecmp($str1, $str2) {
  return strcmp(static::strtoupper($str1), static::strtoupper($str2));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Unicode.php/function/Unicode::strcasecmp/8.1.x