drupal_strtolower

5 unicode.inc drupal_strtolower($text)
6 unicode.inc drupal_strtolower($text)
7 unicode.inc drupal_strtolower($text)
8 unicode.inc drupal_strtolower($text)

Lowercase a UTF-8 string.

Related topics

45 calls to drupal_strtolower()

File

includes/unicode.inc, line 473

Code

function drupal_strtolower($text) {
  global $multibyte;
  if ($multibyte == UNICODE_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]/', '_unicode_caseflip', $text);
    return $text;
  }
}

Comments

In case of fatal errors

If you get a fatal error when invoking drupal_strtolower(), make sure 'includes/unicode.inc' has been loaded first. For an example, see http://drupal.org/node/441634.

Login or register to post comments