;;Mot5Mot6";
> >
> > $length=-1;
> >
> > while ($length != strlen($str)) {
> > $length = strlen($str);
> > $str = str_replace(";;", ";", $str);
> > }
> >
> > echo $str;
> > ?>
> >
> > Return
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
>
> 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
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
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
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;;
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