1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 把字符串转换大写php php把字符串转换为大写的函数strtoupper()

把字符串转换大写php php把字符串转换为大写的函数strtoupper()

时间:2020-08-03 03:53:10

相关推荐

把字符串转换大写php php把字符串转换为大写的函数strtoupper()

实例

把所有字符转换为大写:<?php

echo strtoupper("Hello WORLD!");

?>

定义和用法

strtoupper() 函数把字符串转换为大写。

注释:该函数是二进制安全的。

相关函数:strtolower() - 把字符串转换为小写

lcfirst() - 把字符串中的首字符转换为小写

ucfirst() - 把字符串中的首字符转换为大写

ucwords() - 把字符串中每个单词的首字符转换为大写

语法strtoupper(string)参数描述

string必需。规定要转换的字符串。

技术细节返回值:返回转换为大写的字符串。

PHP 版本:4+

strtoupper() 函数 把字符串转换为大写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");

}

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。