SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Columbus, OH
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Generating all possible combination of words in 3 lists

    I am a professional in the search marketing world, and usually use a certain website as a tool to create my keyword lists which is no longer live... so I'm looking to create my own replacement tool. I hope someone on this list can help me.

    Here's what I need to produce:

    The website used to combine lists of words from 3 inputs into one output list containing every possible combination.

    For Example:

    My three list inputs would be...

    List 1 List 2 List 3
    Red Big Dog
    Blue Small Cat
    Yellow

    and the output would be something like this:

    Red Big Dog
    Red Big Cat
    Red Small Dog
    Red Small Cat
    Blue Big Dog
    Blue Big Cat
    Blue Small Dog
    Blue Small Cat
    Yellow Big Dog
    Yellow Big Cat
    Yellow Small Dog
    Yellow Small Cat

    Anyone have any ideas how I might accomplish this?

    And would it be better to do this with something like JavaScript instead of PHP??

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



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
  •