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'])); Link to comment https://forums.phpfreaks.com/topic/100613-solved-quick-question-in-relation-to-mysql_real_escape_string/ 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 Link to comment https://forums.phpfreaks.com/topic/100613-solved-quick-question-in-relation-to-mysql_real_escape_string/#findComment-514609 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.