public static function sanitize($string, $reverse = false)
    {
        $returnValue = (string) '';

        
		if ($reverse) {
			$smap = array('"', "\n", "\t", "\r");
			$rmap = array('\\"', '\\n"' . "\n" . '"', '\\t', '\\r');
			$returnValue = (string) str_replace($smap, $rmap, $string);
		} else {
			$smap = array('/"\s+"/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\"/');
			$rmap = array('', "\n", "\r", "\t", '"');
			$returnValue = (string) preg_replace($smap, $rmap, $string);
		}
        

        return (string) $returnValue;
    }
public static function sanitize($string, $reverse = false)
    {
        $returnValue = (string) '';

        
		if ($reverse) {
			$smap = array('"', "\n", "\t", "\r");
			$rmap = array('\\"', '\\n"' . "\n" . '"', '\\t', '\\r');
			$returnValue = (string) str_replace($smap, $rmap, $string);
		} else {
			$smap = array('/"\s+"/', '/\\\\n/', '/\\\\r/', '/\\\\t/', '/\\\"/');
			$rmap = array('', "\n", "\r", "\t", '"');
			$returnValue = (string) preg_replace($smap, $rmap, $string);
		}
        

        return (string) $returnValue;
    }
public static function sanitize ( $ string , $ reverse = false ) { $ returnValue = ( string ) '' ; if ( $ reverse ) { $ smap = array ( '"' , "\n" , "\t" , "\r" ) ; $ rmap = array ( '\\"' , '\\n"' . "\n" . '"' , '\\t' , '\\r' ) ; $ returnValue = ( string ) str_replace ( $ smap , $ rmap , $ string ) ; } else { $ smap = array ( '/"\s+"/' , '/\\\\n/' , '/\\\\r/' , '/\\\\t/' , '/\\\"/' ) ; $ rmap = array ( '' , "\n" , "\r" , "\t" , '"' ) ; $ returnValue = ( string ) preg_replace ( $ smap , $ rmap , $ string ) ; } return ( string ) $ returnValue ; }
Short description of method sanitize

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  string string
@param  boolean reverse
@return string
Short description of method sanitize