Functions in replacement string of eregi_replace
| From: | Ville Mattila | Date: | Tue, 11 Jan 2005 07:51:51 +0000 |
| Subject: | Functions in replacement string of eregi_replace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-206057@lists.php.net to get a copy of this message | ||
Hi there!
I'm looking for a workaround to carry out a feature similar to that I could use any PHP function inside the replacement string in eregi_replace (or ereg_replace).
I have a set of HTML code with some <h2>-headers. Now I should convert all HTML headers to uppercase strings. As far as I know and have tested, I can't use code like:
$newstr = eregi_replace("<h3>([a-z0-9 \.!\?]+)</h3>", strtoupper("\\1"));
How could I do that?
Ville