Created
February 2, 2015 17:27
-
-
Save LostKobrakai/d09128adf13bbf588679 to your computer and use it in GitHub Desktop.
Combine each element to another.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = ["lot's", "of", "elements", "…"]; | |
$allConcatinations = []; | |
for ($a=0; $a<count($array); $a++) { | |
for ($b=$a+1; $b<count($array); $b++) { | |
array_push($allConcatinations, $array[$a]." ".$array[$b]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment