Example explanation of string case conversion functions commonly used in php

Among the PHP string processing functions, the simplest functions will not be explained, and the examples will be directly looked at. Among the PHP string processing functions, the simplest functions will not be explained, and the examples will be directly looked at. strtolower function, strtoupper function, ucfirst function, ucwords function

 

<?php
	$str = "it is cool to be you";
	echo strtoupper($str).""; // Convert all strings to uppercase
	echo strtolower($str)."" // Convert all strings to lowercase
	echo ucfirst($str).""; // Convert the first letter of the string to uppercase
	echo ucwords($str).""; // Convert the first letter of each word in the string to uppercase
?>

 Of course, no matter how simple the code is, even if the code is understandable, it may not be able to type. It is recommended to type by hand. If you are a copy party, there is no need to learn a programming language, because you cannot understand the essence of the programming language.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326747795&siteId=291194637