实例
把所有字符转换为大写:
定义和用法
strtoupper() 函数把字符串转换为大写。
注释:该函数是二进制安全的。
相关函数:
strtolower() - 把字符串转换为小写
立即学习
“
PHP免费学习笔记(深入)
”;
PHP 8.5.5
PHP 8.5.5 是 PHP 8.5 分支的维护更新版本。该版本延续了“小步快跑”的迭代逻辑,通过深度错误修复、底层性能微调以及安全加固,旨在为开发者提供一个更健壮、更高效的运行环境。该版本严格遵守语义化版本规范,不包含破坏性变更。
下载
lcfirst() - 把字符串中的首字符转换为小写
ucfirst() - 把字符串中的首字符转换为大写
ucwords() - 把字符串中每个单词的首字符转换为大写
语法
参数描述string必需。规定要转换的字符串。
技术细节
返回值:返回转换为大写的字符串。PHP 版本:4+
strtoupper() 函数 把字符串转换为大写
strtoupper(string) public function set_kw($kw){
$_intAsc=ord(substr($kw,0,1));
if(($_intAsc>64 and $_intAsc<91)or($_intAsc>96 and $_intAsc<123)){
$this->set_query_q('pinyin:'.strtoupper($kw).'*');
}else{
$this->set_dismax_model();
$this->set_query_q($kw);
$this->set_query_qf("name^10 address^5");
}
}