public function escapeString($string)
    {
        if (func_num_args() < 2) {
            if (strpos($string, "\n") !== false) {
                return array('{' . strlen($string) . '}', $string);
            } else {
                return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
            }
        }
        $result = array();
        foreach (func_get_args() as $string) {
            $result[] = $this->escapeString($string);
        }
        return $result;
    }
public function escapeString($string)
    {
        if (func_num_args() < 2) {
            if (strpos($string, "\n") !== false) {
                return array('{' . strlen($string) . '}', $string);
            } else {
                return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
            }
        }
        $result = array();
        foreach (func_get_args() as $string) {
            $result[] = $this->escapeString($string);
        }
        return $result;
    }
public function escapeString ( $ string ) { if ( func_num_args ( ) < 2 ) { if ( strpos ( $ string , "\n" ) !== false ) { return array ( '{' . strlen ( $ string ) . '}' , $ string ) ; } else { return '"' . str_replace ( array ( '\\' , '"' ) , array ( '\\\\' , '\\"' ) , $ string ) . '"' ; } } $ result = array ( ) ; foreach ( func_get_args ( ) as $ string ) { $ result [ ] = $ this -> escapeString ( $ string ) ; } return $ result ; }
escape one or more literals i.e. for sendRequest

@param  string|array $string the literal/-s
@return string|array escape literals, literals with newline ar returned
as array('{size}', 'string');
escape one or more literals i . e . for sendRequest