php trim : The trim() function is used to remove the white spaces and other predefined characters from the left and right sides of a string. How to remove white space from a string in PHP
<?php
$my_str = ' Welcome to Tutorial Pakainfo';
echo strlen($my_str);
$trimmed_str = trim($my_str);
echo strlen($trimmed_str);
?>