note 24263 rejected from function.ereg-replace by maxim
| From: | maxim@php.net | Date: | Sun, 11 Aug 2002 20:11:51 +0000 |
| Subject: | note 24263 rejected from function.ereg-replace by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34816@lists.php.net to get a copy of this message | ||
this is a pain..
I have this code:
$newcontents = "
<MYXMLTAG>
<stuff id=1>
<something>22</something>
</stuff>
<stuff id=2>
<something>22</something>
</stuff>
</MYXMLTAG>
";
and then if I do this:
$regstring = "<stuff id=1>(.*)</stuff>"
$newcontents = ereg_replace($regstring,"INSERT-UPDATED-CODE-HERE",$newcontents);
my result is :
<MYXMLTAG>
INSERT-UPDATED-CODE-HERE
</MYXMLTAG>
Not what I want.. I want :
<MYXMLTAG>
INSERT-UPDATED-CODE-HERE
<stuff id=2>
<something>22</something>
</stuff>
</MYXMLTAG>
what am i doing wrong???