function Unicode::strcasecmp

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Utility/Unicode.php \Drupal\Component\Utility\Unicode::strcasecmp()
  2. 10 core/lib/Drupal/Component/Utility/Unicode.php \Drupal\Component\Utility\Unicode::strcasecmp()
  3. 11.x core/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.

1 call to Unicode::strcasecmp()
ImageStyleEditForm::form in core/modules/image/src/Form/ImageStyleEditForm.php
Gets the actual form array to be built.

File

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

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.