public static function Unicode::strtolower

Lowercase a UTF-8 string.

Parameters

string $text: The string to run the operation on.

Return value

string The string in lowercase.

3 calls to Unicode::strtolower()
drupal_strtolower in drupal/core/includes/unicode.inc
Lowercase a UTF-8 string.
MachineNameController::transliterate in drupal/core/modules/system/lib/Drupal/system/MachineNameController.php
Transliterates a string in given language. Various postprocessing possible.
UnicodeTest::testStrtolower in drupal/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
Tests Unicode::strtolower().

File

drupal/core/lib/Drupal/Component/Utility/Unicode.php, line 291
Contains \Drupal\Component\Utility\Unicode.

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

public static function strtolower($text) {
  if (static::getStatus() == static::STATUS_MULTIBYTE) {
    return mb_strtolower($text);
  }
  else {

    // Use C-locale for ASCII-only lowercase.
    $text = strtolower($text);

    // Case flip Latin-1 accented letters.
    $text = preg_replace_callback('/\\xC3[\\x80-\\x96\\x98-\\x9E]/', '\\Drupal\\Component\\Utility\\Unicode::caseFlip', $text);
    return $text;
  }
}