-
Aug 5th, 2015, 06:07 AM
#1
Thread Starter
Banned
How To Remove Leading and Trailing Spaces from User Input Values in PHP?
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...
?>
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|