Re: EREG_REPLACE

From: Date: Mon, 05 Nov 2001 20:31:39 +0000
Subject: Re: EREG_REPLACE
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73477@lists.php.net to get a copy of this message
$how=preg_match_all('/\<begin\>.(*?)</end\>/',$the_big_string,$matches,PREG_SET_ORDER); for ($counter=1;$counter<=$how;$counter++){ $the_big_string=str_replace($matches[$counter][0], convert_found_string($matches[$counter][1]),$the_big_string); } replace the function convert_found_string with code if it simple or define this function. I think all is clear. If not contact me I will help you as much as I can. Regards, Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Monday 05 November 2001 07:49 am, you wrote: > Hello, > > In a script I want all that is between <begin> and <end> to be replaced. So > if an input starts with <begin> and ends with <end> all that is BETWEEN > must be replaced. > > I know how to replace one or more words: > > $test = ereg_replace("word","",$test); > > Can somebody help me? > > ________________________________________ > Sjoerd van Oosten > Digitaal vormgever svoosten@esites.nl > Datamex E-sites B.V. > Minervum 7368 Telefoon: (076) 5 730 730 > 4817 ZH BREDA Telefax: (076) 5 877 757 > _______________________________________

« previous php.general (#73477) next »