|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
$rambo[1]="daffy duck";
$rambo[2]="mad max"; $rambo[3]="daffy duck"; $rambo[4]="superman"; etc etc How do i remove duplicate strings from a array ? . ('daffy duck' could appear more than twice in the array) I can already do it via a luddite loop - but figure there must be a better/easier way of doing it . -- (stuckle and his lapdogs are forbidden from replying to this thread as i dont actually want any from them) |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Mon, 5 Nov 2007 17:24:39 -0000, Krustov <me@privacy.net> wrote:
>$rambo[1]="daffy duck"; >$rambo[2]="mad max"; >$rambo[3]="daffy duck"; >$rambo[4]="superman"; >etc etc > >How do i remove duplicate strings from a array ? . > >('daffy duck' could appear more than twice in the array) > >I can already do it via a luddite loop - but figure there must be a >better/easier way of doing it . >(stuckle and his lapdogs are forbidden from replying to this thread as i >dont actually want any from them) You don't deserve an answer at all then. -- Regards, Paul Herber, Sandrila Ltd. http://www.sandrila.co.uk/ http://www.pherber.com/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Paul Herber wrote:
> On Mon, 5 Nov 2007 17:24:39 -0000, Krustov <me@privacy.net> wrote: > >> $rambo[1]="daffy duck"; >> $rambo[2]="mad max"; >> $rambo[3]="daffy duck"; >> $rambo[4]="superman"; >> etc etc >> >> How do i remove duplicate strings from a array ? . >> >> ('daffy duck' could appear more than twice in the array) >> >> I can already do it via a luddite loop - but figure there must be a >> better/easier way of doing it . > >> (stuckle and his lapdogs are forbidden from replying to this thread as i >> dont actually want any from them) > > You don't deserve an answer at all then. > Dito. While Jerry can be quite harsh from time to time, he is also damned good with PHP, and what is more: an active usefull contributor to this group. comp.lang.php wouldn't be the same without him. ;-) /me salutes Jerry. Erwin Moller |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Krustov <me@privacy.net> wrote in news:MPG.219962218a7d76d398af19
@news.newsreader.com: > (stuckle and his lapdogs are forbidden from replying to this thread as i > dont actually want any from them) cool, is that drowning in a lake and demanding that certain people be excluded from tossing you a life preserver? drown idiot, drown. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Krustov <me@privacy.net> wrote in news:MPG.219962218a7d76d398af19
@news.newsreader.com: > How do i remove duplicate strings from a array ? . RTFMAMF |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
..oO(Krustov)
>$rambo[1]="daffy duck"; >$rambo[2]="mad max"; >$rambo[3]="daffy duck"; >$rambo[4]="superman"; >etc etc > >How do i remove duplicate strings from a array ? . RTFM. >(stuckle and his lapdogs are forbidden from replying to this thread as i >dont actually want any from them) Go away. Micha |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Mon, 05 Nov 2007 18:24:39 +0100, Krustov <me@privacy.net> wrote:
> $rambo[1]="daffy duck"; > $rambo[2]="mad max"; > $rambo[3]="daffy duck"; > $rambo[4]="superman"; > etc etc > > How do i remove duplicate strings from a array ? . The manual is quite elusive isn't it? -- Rik Wasmus |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
As a regular Stuckle follower/lapdog/whatever I would have suggested
you use: array_intersect or related array searching commands such as: array_intersect_assoc() array_diff() array_diff_assoc() So if you do not wish to taint yourself with Stuckle advice, I'd suggest refraining from using any of the above functions. Have a great day! |
|
![]() |
| Outils de la discussion | |
|
|