473,480 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Duplicate array strings

$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 help from them)
Nov 5 '07 #1
10 2060
On Mon, 5 Nov 2007 17:24:39 -0000, Krustov <me@privacy.netwrote:
>$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 help 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/
Nov 5 '07 #2
Paul Herber wrote:
On Mon, 5 Nov 2007 17:24:39 -0000, Krustov <me@privacy.netwrote:
>$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 help 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
Nov 5 '07 #3
Krustov <me@privacy.netwrote in news:MPG.219962218a7d76d398af19
@news.newsreader.com:
(stuckle and his lapdogs are forbidden from replying to this thread as i
dont actually want any help 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.
Nov 5 '07 #4
Krustov <me@privacy.netwrote in news:MPG.219962218a7d76d398af19
@news.newsreader.com:

How do i remove duplicate strings from a array ? .
RTFMAMF

Nov 5 '07 #5
..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 help from them)
Go away.

Micha
Nov 5 '07 #6
On Mon, 05 Nov 2007 18:24:39 +0100, Krustov <me@privacy.netwrote:
$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
Nov 5 '07 #7
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!

Nov 7 '07 #8
On Wed, 07 Nov 2007 02:57:47 +0100, <la***@portcommodore.comwrote:
array_intersect or related array searching commands such as:

array_intersect_assoc()
array_diff()
array_diff_assoc()
Euhm, well, array_unique() I'd say...
--
Rik Wasmus
Nov 7 '07 #9
Rik Wasmus wrote:
On Wed, 07 Nov 2007 02:57:47 +0100, <la***@portcommodore.comwrote:
>array_intersect or related array searching commands such as:

array_intersect_assoc()
array_diff()
array_diff_assoc()

Euhm, well, array_unique() I'd say...
Let's ask Jerry.
;-)

Regards,
Erwin Moller
Nov 7 '07 #10
<comp.lang.php>
<Erwin Moller>
<Wed, 07 Nov 2007 09:40:06 +0100>
<47*********************@news.xs4all.nl>
array_intersect_assoc()
array_diff()
array_diff_assoc()
Euhm, well, array_unique() I'd say...

Let's ask Jerry.
;-)
$rambo=array_keys(array_flip($rambo));
--
(stuckle and his lapdogs are forbidden from replying to this thread as i
dont actually want any help from them)
Nov 7 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13817
by: Robert | last post by:
Im a beginner in PHP and Im having a problem with this code. Im trying to remove duplicate elements from an array created via $_GET. I want users to be able to click on a link which sends an email...
3
3198
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
9
2980
by: NiQ | last post by:
Hello every one, this is about an array of string and may be have done several time before but i need it and wasnt able to find it so here is the problem i have an array of strings with contains...
7
23898
by: Voetleuce en fênsievry | last post by:
Hello everyone. I'm not a JavaScript author myself, but I'm looking for a method to remove duplicate words from a piece of text. This text would presumably be pasted into a text box. I have,...
2
1465
by: Trond | last post by:
I have been trying to fig out how to build up an array with dates. When its generated i want to be able to remove duplicate dates. The dates is generated by FileInfo object that is scanning a...
9
5074
by: vbportal | last post by:
Hi, I would like to add BitArrays to an ArrayList and then remove any duplicates - can someone please help me forward. I seem to have (at leaset ;-) )2 problems/lack of understanding (see test...
2
22568
by: Potiuper | last post by:
Question: Is it possible to use a char pointer array ( char *<name> ) to read an array of strings from a file in C? Given: code is written in ANSI C; I know the exact nature of the strings to be...
1
16581
by: JTreefrog | last post by:
Hello - I've read a ton of stuff about deleting duplicate values in an array. They are all very useful - they just haven't addressed an array of objects. Here's my array: var sDat = ; The...
5
2333
by: raviufor | last post by:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> #include <ctype.h> #include <ctype.h> #include <time.h> #include <sys/types.h>
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6743
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.