Skip to content

Instantly share code, notes, and snippets.

@saeedsajadi
Created August 6, 2017 12:39
Show Gist options
  • Save saeedsajadi/b18d23be530f26d6f3007bebc2b0ee89 to your computer and use it in GitHub Desktop.
Save saeedsajadi/b18d23be530f26d6f3007bebc2b0ee89 to your computer and use it in GitHub Desktop.
<?php
$arr = [
['R1', 'R2'],
['A1', 'A2', 'A3'],
['M1', 'M2']
];
for ($i = 0; $i < count($arr[0]); $i++){
for ($j = 0; $j < count($arr[1]); $j++) {
for ($k = 0; $k < count($arr[2]); $k++) {
echo $arr[0][$i] . $arr[1][$j] . $arr[2][$k];
echo '<br>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment