mikebyrne Posted April 11, 2008 Share Posted April 11, 2008 I know that the following code is used to prevent SQL Injections but what exactly does the trim do? Does it remove the spaces before and after the variable? $name = mysql_real_escape_string(trim($_POST['name'])); Quote Link to comment Share on other sites More sharing options...
MiCR0 Posted April 11, 2008 Share Posted April 11, 2008 trim(string,charlist) The trim() function removes whitespaces and other predefined characters from both sides of a string. string * Required. Specifies the string to check charlist * "\0" - NULL * "\t" - tab * "\n" - new line * "\x0B" - vertical tab * "\r" - carriage return * " " - ordinary white space Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.