note 102779 added to function.bbcode-create
| From: | tbrisbane at hotmail dot nospammyspam dot com | Date: | Sun, 06 Mar 2011 07:05:53 +0000 |
| Subject: | note 102779 added to function.bbcode-create | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177587@lists.php.net to get a copy of this message | ||
It should be noted that rothenbergxxx at gmail dot com's regex will only work for single line
$innertext. While this is perfectly fine for the majority of the tags, quote tags need multi-line
$innertext.
Here is a fixed version of the regex which supports multi-line $innertext between the opening and
closing tags:
preg_match_all('
\[(.+?)=?(.*?)\]([\s\S]+?)\[/\1\]', $string, $matches)
In my tests, this performs without error. Feel free to post any additional corrections.
----
Server IP: 69.147.83.197
Probable Submitter: 121.218.196.174
----
Manual Page -- http://www.php.net/manual/en/function.bbcode-create.php
Edit -- https://master.php.net/note/edit/102779
Del: integrated -- https://master.php.net/note/delete/102779/integrated
Del: useless -- https://master.php.net/note/delete/102779/useless
Del: bad code -- https://master.php.net/note/delete/102779/bad+code
Del: spam -- https://master.php.net/note/delete/102779/spam
Del: non-english -- https://master.php.net/note/delete/102779/non-english
Del: in docs -- https://master.php.net/note/delete/102779/in+docs
Del: other reasons-- https://master.php.net/note/delete/102779
Reject -- https://master.php.net/note/reject/102779
Search -- https://master.php.net/manage/user-notes.php