How to convert string in Lowercase in Php


To convert string in lowercase Php has inbuilt function strtolower( )
<?php
if(isset($_POST['submit']))
{
$name = strtolower($_POST['name']);

if(empty($name))
{
$msg = "Please enter your full name";
}
else
{
$msg =  "Your name is :- " . $name;
}
}
?>
<!DOCTYPE html>
<html>
<head><title>expertcodingmaster.com</title>
</head>
<body bgcolor="thistle">
<fieldset>
<form method="post" action="">
Enter your full name :- <input type="text" name="name">
<input type="submit" name="submit" value="submit">
</form>
<?php
if(isset($msg))
{
echo "<script>alert('$msg')</script>";
echo  "<font color=yellow size=6px>" . $msg . "</font>";
}
?>
</fieldset>
</body>
</html>

No comments: