You are here

public static function Unicode::strtolower in Zircon Profile 8

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

Converts a UTF-8 string to lowercase.

Parameters

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

Return value

string The string in lowercase.

136 calls to Unicode::strtolower()
AnnotatedClassDiscovery::getProviderFromNamespace in core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
Extracts the provider name from a Drupal namespace.
BlockBase::getMachineNameSuggestion in core/lib/Drupal/Core/Block/BlockBase.php
Suggests a machine name to identify an instance of this block.
BlockContentCreationTest::testBlockDelete in core/modules/block_content/src/Tests/BlockContentCreationTest.php
Test deleting a block.
BlockContentCreationTest::testConfigDependencies in core/modules/block_content/src/Tests/BlockContentCreationTest.php
Test that placed content blocks create a dependency in the block placement.
BlockContentTranslationUITest::getNewEntityValues in core/modules/block_content/src/Tests/BlockContentTranslationUITest.php
Returns an array of entity field values to be tested.

... See full list

File

core/lib/Drupal/Component/Utility/Unicode.php, line 329
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;
  }
}