Need help in Generating Combinations


Posted on 16th Feb 2014 07:03 pm by admin

Need help generating all possible combination of names in an array

Lets say i have the following array:

Did you know?Explore Trending and Topic pages for more stories like this.
$names = array("jack","john","Adam","Mike");

Now my goal is to find all possible combination of 2 names (first name and second name)

e.g. Jack John , Jack Adam, Jack Mike etc...


So how can I do this with PHP?
No comments posted yet

Your Answer:

Login to answer
242 Like 48 Dislike
Previous forums Next forums
Other forums

Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty

single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

how do I show what a user have selected from a checkbox?
From my code below, how would i show which check boxes have been checked and which radio buttons sel

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.

1) on IE when i hit enter instea

PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.

How would I exac

RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai

Sub-domains & calling unique content
Hello,

Is there a way use something similar to the $_GET function for a sub-domain? I to be a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash