This is a discussion on hi all within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Im printing out a list of arrays into screen, however i only want items that are unique to be printed... ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> Im printing out a list of arrays into screen, however i only want items
that > are unique to be printed... so i dont get double items to be printed... how > do i go about that? array_unique() - Removes duplicate values from an array It's in the PHP manual under "Array Functions". It returns the new array, so you'd just have to do something like this: <?php $myArray = array( "big", "badda", "boom" ); $tempArray = array_unique( $myArray ); print_r( $tempArray ); ?> Hope this helps :) - Will Dowling |
|
|||
|
or should i say ... need one for a multi dimensional array
"Spiderman" <darksheep0@hotmail.com> wrote in message news:3f14bac1$1@funnel.arach.net.au... > Im printing out a list of arrays into screen, however i only want items that > are unique to be printed... so i dont get double items to be printed... how > do i go about that? > > > thanks guys. > > > |
|
|||
|
nevermind guys. i figured it out...
but thanks anyway.. aventhough no reply yet :P hehe "Spiderman" <darksheep0@hotmail.com> wrote in message news:3f14cb46$1@funnel.arach.net.au... > or should i say ... need one for a multi dimensional array > "Spiderman" <darksheep0@hotmail.com> wrote in message > news:3f14bac1$1@funnel.arach.net.au... > > Im printing out a list of arrays into screen, however i only want items > that > > are unique to be printed... so i dont get double items to be printed... > how > > do i go about that? > > > > > > thanks guys. > > > > > > > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|