Get the App
SLTechnology News&Howtos  ›  Development  › 

How to capitalize all strings in php

Shulou Source: shulou.com Published: 2022-06-02 05:40:39 09月21日 Update

This article mainly introduces how php capitalizes all the strings. It is very detailed and has a certain reference value. Friends who are interested must finish it!

Php converts all strings to uppercase: 1, create a PHP sample file; 2, define variables to be converted; 3, convert all characters of incoming character parameters to uppercase through "strtoupper ($str);" and return the string in uppercase.

This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.

Convert characters to uppercase:

Strtoupper ():

This function, contrary to the strtolower function, converts all the characters of the passed character parameters to uppercase and returns the string in uppercase. The usage is the same as strtolowe ().

The code is as follows

$str = "Mary Had A Little Lamb and She LOVED It So"; $str = strtoupper ($str); echo $str; / / print MARY HAD A LITTLE LAMB AND SHE LOVED IT SO? >

Related introduction:

Strtolower (): this function converts all characters of the passed string parameter to lowercase and returns the string in lowercase.

The above is all the contents of the article "how php capitalizes all strings". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Character uppercase string function parameter form content article code value function interest variable buddy lowercase file method more environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Shulou Tech Info Xiaomi Microsoft