在 PHP 中,mb_strtoupper()是一個內置函數,用於將給定的字符串更改為大寫。
用法
string mb_strtoupper(str $string, str $encoding)
參數
mb_strtoupper()接受兩個參數:$string和$encoding。
$string−字符串被大寫。
$encoding−該參數是字符編碼。如果它不存在或為空,則將使用內部字符編碼值。
返回值
string將所有字母字符轉換為大寫。
示例
<?php
$string = "Hello World!, Welcome to online tutorials";
$string = mb_strtoupper($string);
echo $string;
?>
輸出
它會將給定的字符串轉換為大寫。
HELLO WORLD!, WELCOME TO ONLINE TUTORIALS
相關用法
- PHP mb_strtolower()用法及代碼示例
- PHP mb_strlen()用法及代碼示例
- PHP mb_substitute_character()用法及代碼示例
- PHP mb_substr_count()用法及代碼示例
- PHP mb_substr()用法及代碼示例
- PHP mb_check_encoding()用法及代碼示例
- PHP mb_detect_order()用法及代碼示例
- PHP mb_chr()用法及代碼示例
- PHP mb_convert_case()用法及代碼示例
- PHP metaphone()用法及代碼示例
- PHP mhash_get_hash_name()用法及代碼示例
- PHP mysqli_get_server_info()用法及代碼示例
- PHP money_format()用法及代碼示例
- PHP mysqli_data_seek()用法及代碼示例
- PHP mysqli_insert_id()用法及代碼示例
- PHP mysqli_fetch_assoc()用法及代碼示例
- PHP mkdir()用法及代碼示例
- PHP mysqli_connect_error()用法及代碼示例
- PHP mhash_keygen_s2k()用法及代碼示例
注:本文由純淨天空篩選整理自Urmila Samariya大神的英文原創作品 PHP – Make an upper case string using mb_strtoupper()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。