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, ∼3278🔥, 0💬
Popular Posts:
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How To Access a Global Variable inside a Function? in PHP? By default, global variables are not acce...