Re: [PHP-WIN] String reduce

2002-04-12 Thread Nicole Amashta
;;Mot5Mot6"; > > > > $length=-1; > > > > while ($length != strlen($str)) { > > $length = strlen($str); > > $str = str_replace(";;", ";", $str); > > } > > > > echo $str; > > ?> > > > > Return

Re: [PHP-WIN] String reduce

2002-04-12 Thread Nicole Amashta
shorter. This one works and is pretty neat: > > > > > > > $str = "Mot1;;Mot2;Mot3;;Mot4;;;Mot5Mot6"; > > > > $length=-1; > > > > while ($length != strlen($str)) { > > $length = strlen($str); > > $str = str_replace

Re: [PHP-WIN] String reduce

2002-04-12 Thread Nicole Amashta
> > while ($length != strlen($str)) { > $length = strlen($str); > $str = str_replace(";;", ";", $str); > } > > echo $str; > ?> > > Returns: > Mot1;Mot2;Mot3;Mot4;Mot5;Mot6 > as required > > Regards > > Ross > > -Or

RE: [PHP-WIN] String reduce

2002-04-12 Thread Ross Fleming
bono [mailto:[EMAIL PROTECTED]] Sent: 12 April 2002 18:31 To: Matt Babineau Cc: [EMAIL PROTECTED] Subject: RE: [PHP-WIN] String reduce I added the underscore artificially in order to make the string become Mot1_;__;_Mot2_;__;__;__;__;__;__;__;__;__;_Mot3_;__;__;_andsoon;;;M ot4;;;Mot5Mot6

RE: [PHP-WIN] String reduce

2002-04-12 Thread Nicola Delbono
On 12/04/2002 at 12.50 Matt Babineau wrote: >What does the underscore do in this situation? > >-----Original Message- >From: Nicola Delbono [mailto:[EMAIL PROTECTED]] >Sent: Friday, April 12, 2002 12:43 PM >To: Kriegers Horst; 'PHP-Windows' >Subject: Re: [PHP-W

RE: [PHP-WIN] String reduce

2002-04-12 Thread Matt Babineau
What does the underscore do in this situation? -Original Message- From: Nicola Delbono [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 12:43 PM To: Kriegers Horst; 'PHP-Windows' Subject: Re: [PHP-WIN] String reduce try $str = "Mot1;;Mot2;Mot3;;

Re: [PHP-WIN] String reduce

2002-04-12 Thread Nicola Delbono
try $str = "Mot1;;Mot2;Mot3;;Mot4;;;Mot5Mot6"; $str = str_replace(";", "_;_", $str); $str = str_replace("__;_", "", $str); :-D *** REPLY SEPARATOR *** On 12/04/2002 at 16.10 Kriegers Horst wrote: >Hi all, > >how can I replace the n ; with only o