How to convert English lowercase to uppercase in php

WJ
Release: 2023-03-01 09:32:01
Original
34332 people have browsed it

php method to convert English lowercase to uppercase: first create a new "test.php" file; then create the code "$str = strtoupper($str)" in the file; finally run " localhost/test.php".

How to convert English lowercase to uppercase in php

Recommended: "PHP Video Tutorial"

##php Method to convert English primary school to uppercase:

The function of php to convert lowercase to uppercase is: strtoupper()

First create a new test.php file and add the following content:


<?php
  $str = "www.php.cn";
  $str = strtoupper($str);
  echo $str;
?>
Copy after login

Then run the file in the browser

How to convert English lowercase to uppercase in php

Function introduction:

strtoupper() Function converts a string to uppercase.

Note: This function is binary safe.

Related functions:

lcfirst() - Convert the first character in the string to lowercase
strtolower() - Convert the string to lowercase
ucfirst() - Convert the string to lowercase Convert the first character in the string to uppercase
ucwords() - Convert the first character of each word in the string to uppercase

Syntax:

strtoupper(string)
Copy after login

Parameters


string required. Specifies the string to be converted.

Return value: Returns the string converted to uppercase.


The above is the detailed content of How to convert English lowercase to uppercase in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template