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, 2818🔥, 0💬
Popular Posts:
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to search for the first match of a regular expression using re.search()? The re.search() functio...
How to start Visual Studio Command Prompt? I have Visual Studio 2017 Community version with Visual C...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...