note 27126 added to function.highlight-string

From: Date: Sat, 23 Nov 2002 22:22:05 +0000
Subject: note 27126 added to function.highlight-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-39903@lists.php.net to get a copy of this message
PHP's highlight functions seem to have problem highlighting \n newlines. I have oftern seen syntax errors being produced by these funstions. (Resulting in buggy code being posted on the net as a result.) Try highlighing the following and you will see what I mean. <?php $str = preg_replace(\"/(\r\n|\n|\r)/\", \"\n\", $str); $str = preg_replace(\"/\n\n+/\", \"\n\n\", $str); ?> -- http://www.php.net/manual/en/function.highlight-string.php http://master.php.net/manage/user-notes.php?action=edit+27126 http://master.php.net/manage/user-notes.php?action=delete+27126 http://master.php.net/manage/user-notes.php?action=reject+27126

« previous php.notes (#39903) next »