odata/library/ODataProducer/Writers/Json/JsonWriter.php
/**
     * Returns the string value with special characters escaped
     * 
     * @param string $string input string value
     * 
     * Returns the string value with special characters escaped.
     * 
     * @return string
     */
Returns the string value with special characters escaped



Returns the string value with special characters escaped.

@return string
Returns the string value with special characters escaped Returns the string value with special characters escaped . @return string
private function _quoteJScriptString($string)
    {
        $search  = array('\\', "\n", "\t", "\r", "\b", "\f", '"');
        $replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"');
        $processedString  = str_replace($search, $replace, $string);
        $processedString = str_replace(array(chr(0x08), chr(0x0C)), array('\b', '\f'), $processedString);
        return $processedString;
    }
private function _quoteJScriptString ( $ string ) { $ search = array ( '\\' , " \n " , " \t " , " \r " , " \b " , " \f " , '"' ) ; $ replace = array ( '\\\\' , '\\n' , '\\t' , '\\r' , '\\b' , '\\f' , '\"' ) ; $ processedString = str_replace ( $ search , $ replace , $ string ) ; $ processedString = str_replace ( array ( chr ( 0x08 ) , chr ( 0x0C ) ) , array ( '\b' , '\f' ) , $ processedString ) ; return $ processedString ; }
Returns the string value with special characters escaped
Returns the string value with special characters escaped
// Escape ( " \ / \n \r \t \b \f) characters with a backslash. // Escape some ASCII characters(0x08, 0x0c)