Ever got extra white spaces and dont wanna clear them manually or just cannot? In PHP, we have a great function called trim(), which will do your job. If you made a .htaccess rewrite (most of the cases), or just a form input to validate and clear its extra white spaces just do a trim().
<?php $extraWhiteSpace = " bla bllla b l a"; $extraWhiteSpace = trim($extraWhiteSpace); ?>
Hi! the function is not working.
Its not printing any thing.
will it remove the whitespaces or the string having illegal spaces?
Thanks
Of course it’s working but you need to add
print $extraWhiteSpace;