Get ALL possible results from mixing array

后端 未结 3 587
独厮守ぢ
独厮守ぢ 2021-01-13 02:01

I\'ve looked everywhere for this online, but couldn\'t completely find it. (my PHP and math skills are letting my down for this one...) I have an array containing for exampl

3条回答
  •  鱼传尺愫
    2021-01-13 02:23

    As always, it's much more fun to solve the problem your own way. You can modify your code to fit your special needs much easier then, because you know what you are doing :) See my test script below:

    \n";                                          
    getAll('', $a);                                          
    echo "
    \n"; ?>

    I just echo'd the intended output, you could add up a result array instead, but that's your part :)

    Output:

    [] //empty value is included, but blank lines won't show up here, so I wrote []
    a
    ab
    abc
    ac
    acb
    b
    ba
    bac
    bc
    bca
    c
    ca
    cab
    cb
    cba
    

提交回复
热议问题