PHP converts string to uppercase function strtoupper()

黄舟
Release: 2023-03-17 07:04:01
Original
1604 people have browsed it

Example

Convert all characters to uppercase:

Copy after login

Definition and usage

strtoupper() function converts a string to uppercase.

Note: This function is binary safe.

Related functions:

  • strtolower() - Convert the string to lowercase

  • lcfirst() - Convert the string to lowercase Convert the first character in the string to lowercase

  • ucfirst() - Convert the first character in the string to uppercase

  • ucwords() - Convert the first character in the string to uppercase Convert the first character of each word in the string to uppercase

Syntax

strtoupper(string)
Copy after login
Parameters Description
string Required. Specifies the string to be converted.

Technical details

Return value: Returns the string converted to uppercase.
PHP version: 4+
## The strtoupper() function converts the string to uppercase

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"); } }
Copy after login


The above is the detailed content of PHP converts string to uppercase function strtoupper(). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!