How can I remove spaces from around a string value?
<?php
$toomuchspace = " how are you ";
echo "<$toomuchspace>\n";
$thatsbetter = trim($toomuchspace);
echo "<$thatsbetter>";
?>
And this is the result:
< how are you >
More strings PHP Questions
How do I one-way encrypt a string in PHP?How do I check if a string contains HTML?
How do I find the length of a string in PHP?
How do I count how many times each character occurs in a string?
How do I turn a string into an array?