How To Remove Leading And Trailing Spaces From User Input Values In PHP

How To Remove Leading And Trailing Spaces From User Input Values In PHP


  • 25 Feb, 2012

    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...?>

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.