Tools, FAQ, Tutorials:
Removing Leading and Trailing Spaces in PHP
How To Remove Leading and Trailing Spaces from User Input Values?
✍: FYIcenter.com
If you are taking input values from users with a Web form, users may enter extra spaces at the beginning and/or the end of the input values. You should always use the trim() function to remove those extra spaces as shown in this PHP script:
<?php $name = $_REQUEST("name"); $name = trim($name); # $name is ready to be used... ?>
⇐ Remove Trailing New Line Character in PHP
2016-10-13, 2662🔥, 0💬
Popular Posts:
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
How to run CMD Commands in Dockerfile to change Windows Docker images? When building a new Windows i...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...