PHP/MySQL,HTML,JavaScript,Java Programming examples. Free Software, Earn Money Online.
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
Tweet
Subscribe to:
Post Comments (Atom)
Im following you with google connect and Networked Blogs.. please send back the favor. thanks
ReplyDeletehttp://melvenko.blogspot.com
ReplyDeleteI like the content of this blog, I'll definitely be following.
ReplyDeleteActiveX Controls
ReplyDelete