Re: Remove Dynamic String between StringA and StringB

From: Date: Tue, 27 Jan 2004 00:28:22 +0000
Subject: Re: Remove Dynamic String between StringA and StringB
Groups: php.general 
Request: Send a blank email to php-general+get-175841@lists.php.net to get a copy of this message
<snip> Hi :), i'm looking for a function to remove multiple dynamic parts of a string, there are only the start and end strings given (remove all between string A and string B) got somebody a working procedure for that? regards </snip> a start of a procedure I have $stringA = "string A"; $stringB = "string B"; $string = "remove all between string A and string B"; $pattern = "/$stringA.\w*.$stringB/"; $replacement = "$stringA$stringB"; echo preg_replace($pattern, $replacement, $string);

« previous php.general (#175841) next »