<?php
function _unicode_caseflip($matches) {
return $matches[0][0] . chr(ord($matches[0][1]) ^ 32);
}
function drupal_strtolower($text, $multibyte_unicode) {
if ($multibyte_unicode) {
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;
}
}
$arr = [];
$arr[] = drupal_strtolower(TRUE, TRUE);
$arr[] = drupal_strtolower(TRUE, FALSE);
$arr[] = drupal_strtolower(FALSE, TRUE);
$arr[] = drupal_strtolower(FALSE, FALSE);
$arr[] = (bool)drupal_strtolower(TRUE, TRUE);
$arr[] = (bool)drupal_strtolower(TRUE, FALSE);
$arr[] = (bool)drupal_strtolower(FALSE, TRUE);
$arr[] = (bool)drupal_strtolower(FALSE, FALSE);
var_export($arr);
preferences:
17.89 ms | 402 KiB | 5 Q