| @@ 4863-4877 (lines=15) @@ | ||
| 4860 | * |
|
| 4861 | * @return string str with all alphabetic characters converted to lowercase. |
|
| 4862 | */ |
|
| 4863 | public static function strtolower($str, $encoding = 'UTF-8') |
|
| 4864 | { |
|
| 4865 | // init |
|
| 4866 | $str = (string)$str; |
|
| 4867 | ||
| 4868 | if (!isset($str[0])) { |
|
| 4869 | return ''; |
|
| 4870 | } |
|
| 4871 | ||
| 4872 | if ($encoding !== 'UTF-8') { |
|
| 4873 | $encoding = self::normalize_encoding($encoding); |
|
| 4874 | } |
|
| 4875 | ||
| 4876 | return \mb_strtolower($str, $encoding); |
|
| 4877 | } |
|
| 4878 | ||
| 4879 | /** |
|
| 4880 | * Generic case sensitive transformation for collation matching. |
|
| @@ 4901-4914 (lines=14) @@ | ||
| 4898 | * |
|
| 4899 | * @return string str with all alphabetic characters converted to uppercase. |
|
| 4900 | */ |
|
| 4901 | public static function strtoupper($str, $encoding = 'UTF-8') |
|
| 4902 | { |
|
| 4903 | $str = (string)$str; |
|
| 4904 | ||
| 4905 | if (!isset($str[0])) { |
|
| 4906 | return ''; |
|
| 4907 | } |
|
| 4908 | ||
| 4909 | if ($encoding !== 'UTF-8') { |
|
| 4910 | $encoding = self::normalize_encoding($encoding); |
|
| 4911 | } |
|
| 4912 | ||
| 4913 | return \mb_strtoupper($str, $encoding); |
|
| 4914 | } |
|
| 4915 | ||
| 4916 | /** |
|
| 4917 | * Translate characters or replace sub-strings. |
|