note 43371 deleted from function.preg-replace by aidan
| From: | aidan@php.net | Date: | Sun, 22 Aug 2004 13:07:57 +0000 |
| Subject: | note 43371 deleted from function.preg-replace by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75103@lists.php.net to get a copy of this message | ||
Note Submitter: steveo6500
----
Just to add another "don't-do-this-unless-you-want-a-headache" note...
I started with preg_replace a little bit ago and the numbers in the second arguement of the function
was confusing me. For example...
<?php
preg_replace("|\[div](.+)\[/div]|ise", "<div
class='whatever'>\\1</div>", $string);
?>
"\\1" is the first parenthysised (I can never spell that word...) group, in this case
whatever is inside the [div][/div] tags, or .+ in this example. For some reason, "\$1"
doesn't work with me.