String Handling

30


<html>
<head>
 <title>String Handling Functions</title>
</head>
<body>
 <center>
 <b><h1>String Handling Functions</h1></b>
 <form action="stringfunc.php" method="get">
 1. String Functions<br>
 2. Math Functions<br>
 Enter your choice: <input type="text" name="choice"/><br>
 <input type="submit" name="visit" value="Submit"/><br>
 </form>
 
 <?php
 $n = $_GET["choice"];
 switch ($n) {
 case 1:
 $str = "Hello World!";
 echo strlen($str) . "<br>";
 echo strrev($str) . "<br>";
 echo trim($str) . "<br>";
 echo rtrim($str) . "<br>";
 echo ltrim($str) . "<br>";
 echo strtoupper($str) . "<br>";
 echo strtolower($str) . "<br>";
 break;
 
 case 2:
 echo abs(-7) . "<br>";
 echo pi() . "<br>";
 echo floor(0.60) . "<br>";
 echo ceil(0.60) . "<br>";
 echo round(1.95583, 2) . "<br>";
 echo round(1241757, -3) . "<br>";
 echo is_finite(234) . "<br>";
 break;
 }
 ?>
 </center>
</body>
</html>