PHPRtfLite::quoteRtfCode PHP Method

quoteRtfCode() public static method

quotes rtf code
public static quoteRtfCode ( string $text, boolean $convertNewlines = true ) : string
$text string
$convertNewlines boolean
return string
    public static function quoteRtfCode($text, $convertNewlines = true)
    {
        // escape backslashes and curly brackets
        $text = str_replace(array('\\', '{', '}'), array('\\\\', '\\{', '\\}'), $text);
        if ($convertNewlines) {
            $text = self::convertNewlinesToRtfCode($text);
        }
        return $text;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * renders footnote/endnote
  *
  * @return string
  */
 public function getContent()
 {
     $content = '\\chftn ' . '{\\footnote' . ($this->isFootnote() ? '' : '\\ftnalt') . '\\pard\\plain \\lin283\\fi-283 ';
     if ($this->_parFormat) {
         $content .= $this->_parFormat->getContent($this->_rtf);
     }
     $content .= $this->_font->getContent($this->_rtf);
     $content .= '{\\up6\\chftn}' . "\r\n" . PHPRtfLite::quoteRtfCode($this->_text) . '} ';
     return $content;
 }
All Usage Examples Of PHPRtfLite::quoteRtfCode