Created
August 6, 2017 13:59
-
-
Save saeedsajadi/931358399be55a617ccb674fdc26471d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$arr = [ | |
['R1', 'R2', 'R3'], | |
['A1', 'A2', 'A3'], | |
['M1', 'M2'] | |
]; | |
$result = [""]; | |
foreach ($arr as $item) { | |
$tmp = []; | |
foreach ($item as $el) { | |
foreach ($result as $curr) { | |
array_push($tmp, $curr . $el); | |
} | |
} | |
$result = $tmp; | |
} | |
echo json_encode($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment