How to convert string in Uppercase in Php


To convert string in uppercase Php has inbuilt function strtoupper( ) using this function one can convert the lowercase string into uppercase.
<?php
if(isset($_POST['submit']))
{
$name = strtoupper($_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: