How-To: Removing trailing whitespace from a string with php
Jul.11, 2008 in
Development, How To
Need to remove the trailing whitespace characters from a string in php? chomp() is how you do it in Perl, however in PHP it’s just as easy. Simply use rtrim(): // $string = “|my string with trailing whitespace |” $string = rtrim($string); // $string = “|my string with trailing whitespace|” It’s that easy! There is [...]
