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");

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值