Advertisement
reenadak

Unsanitize Input

Feb 20th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1.     /*
  2.     - Unsanitize Input
  3.     - Strips slashes from the input (eg. turns dog\'s into dog's)
  4.    
  5.     $string     - The string you want to unsanitize.
  6.     $multiline  - Turns \n into HTML <br />
  7.     */
  8.    
  9.     public function unsanitizeInput($string, $multiline = false) {
  10.        
  11.         if ($multiline)
  12.             $string = nl2br(stripslashes($string));
  13.         else
  14.             $string = stripslashes($string);
  15.        
  16.         return $string;
  17.        
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement