You are here

public static function Unicode::strcasecmp in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/Utility/Unicode.php \Drupal\Component\Utility\Unicode::strcasecmp()

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

lib/Drupal/Component/Utility/Unicode.php, line 588
Contains \Drupal\Component\Utility\Unicode.

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));
}