note 29844 added to function.preg-replace-callback

From: Date: Wed, 26 Feb 2003 17:30:41 +0000
Subject: note 29844 added to function.preg-replace-callback
Groups: php.notes 
Request: Send a blank email to php-notes+get-44562@lists.php.net to get a copy of this message
preg_replace_callback is the best solution to parse HTML-tags, as you can use the same invoked function for different numbers of attributes, e.g. if you want to cache them in an array in order to restructure the document or the tags later. The code gets clearer and you don't need to define several replacements for it. It also seems to accept all kinds of characters in the subpatterns. (quoted delimiters like "\{" or "\(" are treated as characters and not as delimiters when they are passed to the callback-function) -- http://www.php.net/manual/en/function.preg-replace-callback.php http://master.php.net/manage/user-notes.php?action=edit+29844 http://master.php.net/manage/user-notes.php?action=delete+29844 http://master.php.net/manage/user-notes.php?action=reject+29844

« previous php.notes (#44562) next »