note 24263 added to function.ereg-replace

From: Date: Sun, 11 Aug 2002 08:57:56 +0000
Subject: note 24263 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-34803@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??? -- http://www.php.net/manual/en/function.ereg-replace.php http://master.php.net/manage/user-notes.php?action=edit+24263 http://master.php.net/manage/user-notes.php?action=delete+24263 http://master.php.net/manage/user-notes.php?action=reject+24263

« previous php.notes (#34803) next »