Consider the following array:
$input = array('A', 'B', 'C', 'D');
I am looking for a way to make a loop, although this array, writing down all possible pairs of two values. In this example: AB AC AD BC BD CD. Please, not that BA is not considered a pair, as AB is already mentioned:
$output = array( 'A' => 'B', 'A' => 'C', 'A' => 'D', 'B' => 'C', 'B' => 'D' );
Any input on how to do this is welcome.
Pr0no source share