strtolower(): to change all upper case chars to lower case

$my_str="Hello welcome to plus2net.com";
$my_str=strtolower($my_str);
echo $my_str;
Above code output will be
hello welcome to plus2net.com
Syntax
$val=strtolower($input_sting);

DEMO

Output :

Example 1: Converting Mixed Case String

<?php
$str = "HELLO World!";
echo strtolower($str);  // Output: hello world!
?>

Example 2: Handling String with Numbers

<?php
$str = "PHP 101: Programming";
echo strtolower($str);  // Output: php 101: programming
?>

Example 3: Converting a Sentence with Mixed Characters

<?php
$str = "PHP is Fun, but ALSO CHALLENGING!";
echo strtolower($str);  // Output: php is fun, but also challenging!
?>

Example 4: Converting a Multi-Line String

<?php
$str = "This is LINE 1\nTHIS IS LINE 2\n";
echo strtolower($str);  // Output: this is line 1\nthis is line 2\n
?>

String Functions first letter of every word to capitalize by using ucwords Change all alphabetic chars to Upper case Checking all lower case or upper case chars in a string


Subscribe to our YouTube Channel here



plus2net.com







fahim

01-01-2013

good code




PHP video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer