×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to strip the whitespaces at the beginning and the end of a string?


PHP - How to strip the whitespaces at the beginning and the end of a string?

You may use the special PHP function trim.
 
<?php
 
$myText=" car  ";
 
echo trim($myText);
 
?>
 
will display:
 
"car"

Category: PHP

 
<< Go back