SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    May 2002
    Posts
    1,370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dupe checking - prior to arrays

    Wondering what the best way to check for dupes in $paints.
    Each value may contains one or two part names.
    ex. all here would be considered unique except 'ebony stain':

    PHP Code:
    $paints "ebony stain, orange stain, stain, green stain, ebony stain"
    $paints are being copied and pasted into arrays, there cannot be dupes.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    unique array

    array_unique() ??

    EDIT. lol, just read the thread title.
    Of course this would mean "explode()ing" the sting into a temp array before merge()ing into the "real" array.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •