Programming Tutorials

(追記) (追記ここまで)

PHP convert string to lower case

By: Manoj in PHP Tutorials on 2023年03月22日 [フレーム]

In PHP, you can convert a string to lowercase using the strtolower() function. Here is an example:

$str = "HELLO WORLD"; 
$str_lower = strtolower($str);
echo $str_lower; // Output: hello world

In the example above, we first define a string $str in uppercase. We then use the strtolower() function to convert it to lowercase and store the result in a new variable $str_lower. Finally, we output the lowercase string using the echo statement.

Note that strtolower() function returns a new string in lowercase and doesn't modify the original string. If you want to modify the original string, you can assign the result of strtolower() back to the original variable:

$str = "HELLO WORLD"; 
$str = strtolower($str);
echo $str; // Output: hello world



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /