/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
Getting info from array
Fra : Christian Borchgrevi~


Dato : 24-04-02 18:18

I have an array with lots of equal integers. Then i want to "convert" this
array to an array with only on occassion of each number.

Eg:

firstArray (1,3,4,3,4,3,3,3,3,2)

My goal:

secondArray(1,2,3,4)

Is this possible somehow?

Thanks

Christian



 
 
Nezar Nielsen (24-04-2002)
Kommentar
Fra : Nezar Nielsen


Dato : 24-04-02 19:22

"Christian Borchgrevink-Lund" <borchgrevink@yahoo.com> wrote in message
news:3cc6e8ee$0$10874$ba624c82@nntp01.dk.telia.net...
> I have an array with lots of equal integers. Then i want to "convert" this
> array to an array with only on occassion of each number.
...
> firstArray (1,3,4,3,4,3,3,3,3,2)
...
> secondArray(1,2,3,4)
>
> Is this possible somehow?

Yes, just use the force ..err the fine manual:
http://dk.php.net/manual/en/function.array-unique.php

--
Mvh. Nezar Nielsen

Nano - Advanced Simplicity
http://www.nano.dk/




Christian Borchgrevi~ (24-04-2002)
Kommentar
Fra : Christian Borchgrevi~


Dato : 24-04-02 19:34

Thanks


"Nezar Nielsen" <tumpen@fez.dk> wrote in message
news:3cc6f7e4$0$97300$edfadb0f@dspool01.news.tele.dk...
> "Christian Borchgrevink-Lund" <borchgrevink@yahoo.com> wrote in message
> news:3cc6e8ee$0$10874$ba624c82@nntp01.dk.telia.net...
> > I have an array with lots of equal integers. Then i want to "convert"
this
> > array to an array with only on occassion of each number.
> ..
> > firstArray (1,3,4,3,4,3,3,3,3,2)
> ..
> > secondArray(1,2,3,4)
> >
> > Is this possible somehow?
>
> Yes, just use the force ..err the fine manual:
> http://dk.php.net/manual/en/function.array-unique.php
>
> --
> Mvh. Nezar Nielsen
>
> Nano - Advanced Simplicity
> http://www.nano.dk/
>
>
>



Søg
Reklame
Statistik
Spørgsmål : 177559
Tips : 31968
Nyheder : 719565
Indlæg : 6408938
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste