I used Sanitize::clean in cakePHP to sanitize user input and in result I got "\r" character.
- What does this character mean ("\r") ?
- Is there a function that does the reverse of Sanitize::clean, so I can use before outputting the data.
I used Sanitize::clean in cakePHP to sanitize user input and in result I got "\r" character.
"\r" is the Carriage Return character (when printing to the console, it causes output to start on the next line but does not affect display of web pages).
You can get rid of this character (and others) by calling trim($userInput);
or this way using Sanitize::clean
:
$opts = array('carriage'=>true);
$cleaned = Sanitize::clean($userInput,$opts);