phpbar.de logo

Mailinglisten-Archive

[php] doppelte Zeichen

[php] doppelte Zeichen

QUAD php_(at)_phpcenter.de
Tue, 10 Apr 2001 14:11:00 +0200


----- Original Message -----
From: <Frank.Schreiber_(at)_lr-online.de>

> ich habe z.B. ein String  $str = A,A,A,B,B,C,C;
> Jetzt möchte ich alle doppelten Buchstaben entfernen.

Hi, das sollte dir helfen.

$str_org = "A,A,A,B,B,B,C,C,C";
$help  = split(",",$str_org);
foreach ($help as $letter) {if(!preg_match("/$letter/",$str_new)) $str_new
.= "$letter";}
print "Org.: $str_org<P>New.: $str_new<P>";


Mfg

--
Tino Ehrich
application designer
goto IT-Solutions GmbH
Wilhelm-Wagenfeld-Straße 1
13086 Berlin

Tel. +49 30.92.401 -555
Fax  +49 30.92.401 -599
Mobile  +49.172.600.62.02
mailto: tehrich_(at)_goto-it.de
ICQ     #103290811
_________________________________________________
The information contained in this message is for
the intended addressee only and may contain
confidential and/or privileged information.
If you are not the intended addressee, please
delete this message and notify the sender; do not
copy or distribute this message or disclose its
contents to anyone. Any views or opinions expressed
in this message are those of the author and do not
necessarily represent those of CH-850 [global media]
or of any of its associated companies.  No reliance
may be placed on this message without written
confirmation from an authorised representative
of the company !
_________________________________________________





php::bar PHP Wiki   -   Listenarchive