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, ∼4015🔥, 0💬
Popular Posts:
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How to use the "set-backend-service" Policy Statement for an Azure API service operation? The "set-b...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...