fork(1) download
  1. <?php
  2. $arr = array("A","B","C");
  3.  
  4. for ($i = 0; $i < count($arr); $i++) {
  5. echo $arr[$i]."\n";
  6. for ($j = 0; $j < count($arr); $j++) {
  7. if ($i != $j) {
  8. echo $arr[$i].$arr[$j]."\n";
  9. for ($k = 0; $k < count($arr); $k++) {
  10. if ($i != $j && $i != $k && $j != $k) {
  11. echo $arr[$i].$arr[$j].$arr[$k]."\n";
  12. }
  13. }
  14. }
  15. }
  16. }
  17.  
  18. ?>
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
A
AB
ABC
AC
ACB
B
BA
BAC
BC
BCA
C
CA
CAB
CB
CBA