Trimming Strings : String Case : String PHP Source Code


PHP Source Code » String » String Case »

 

Trimming Strings



<html>
<head>
<title>Trim Functions</title>
</head>
<body>
<span>
<?php
     $TrailingSpaces = "Trailing Spaces             ";
     $Leadingspaces = "             Leading spaces";
     $TrailingAndLeadingSpaces = "            Trailing and Leading Spaces         ";
     $TabString = $HTTP_USER_AGENT . "  nnn      tt rr";
   
     print(""$TrailingSpaces"" "<br />");
     print(""$Leadingspaces"" "<br />");
     print(""$TrailingAndLeadingSpaces"" "<br />");
     print(""$TabString"" "<br />");
   
     $TrailingSpaces = chop($TrailingSpaces);
     $Leadingspaces = ltrim($Leadingspaces);
     $TrailingAndLeadingSpaces = trim($TrailingAndLeadingSpaces);
     $TabString = trim($TabString);
   
     print("<br/>");
   
     print(""$TrailingSpaces"" "<br />");
     print(""$Leadingspaces"" "<br />");
     print(""$TrailingAndLeadingSpaces"" "<br />");
     print(""$TabString"" "<br />");
?>
</span>
</body>
</html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo String
» String Case