Jump to content
Larry Ullman's Book Forums

Adding Backslashes, Script 13.1 Step 5


Recommended Posts

Hello,

I have small problem with script 13.1, particularly with step 5.
Book explains that this code:

$value = str_replace(array("\r", "\n", "%0a", "%0d"), ' ', $value);

is going to create new value that is free of newline characters.

 

It is true when I enter to the form string with "%0a" and "%0d" but it is not true for "\r" and "\n".
When entering email "test@test.com\n" it creates "test@test.com\\n" (it adds backslash).

 

Does anyone know why this is happening?
Thanks for any suggestion.

Link to comment
Share on other sites

 Share

×
×
  • Create New...