String Functions in PHP




<?php
if(isset($_POST['t1']))
 {
  $st=$_POST['t1'];
echo "String in  Proper Case:<b> ";
echo (ucwords(strtolower($st)));
echo "</b><br/>String $st has <b>". strlen( $st ) ."</b> characters<br/>";
echo "String in Lower case <b>" . strtolower($st)."</b><br/>";
echo "String in Upper case <b>" . strtoupper($st)."</b><br/>";
echo "String Reversed <b>" . strrev($st)."</b><br/>";
}


?>


<html>
<body bgcolor='#cccfaa'><form name='frm1' method='post'>
Enter any String:<input type='text' name='t1' />
<input type='submit' value='String functions' /></form>
</body>
</html>


**Note:
    1) strlen( $st ) : returns no. of characters in a String
    2) strtolower( $st ) : returns lowercase String
    3) strtoupper( $st ) : returns uppercase String
    4) strrev( $st ) : returns reverse of a  String




3 comments:

  1. Im following you with google connect and Networked Blogs.. please send back the favor. thanks

    ReplyDelete
  2. http://melvenko.blogspot.com

    ReplyDelete
  3. I like the content of this blog, I'll definitely be following.

    ReplyDelete

Thanks for visiting my Blog!

Have a Question ? Need Help in College Assignments, Need Code that is not available here? Just leave a comment & get your code instantly.

Tips to Enhance Your Blog