PHP 中的组合、处置和排列 [英] Combinations, Dispositions and Permutations in PHP

查看:40
本文介绍了PHP 中的组合、处置和排列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 PHP 中生成数组的所有组合、排列和排列的最有效方法是什么?

What is the most efficient way to generate all the combinations, dispositions and permutations of an array in PHP?

推荐答案

这是获取所有排列的代码:

Here is code to get all permutations:

http://php.net/manual/en/function.shuffle.php#90615

得到幂集的代码,排列是最大长度的,幂集应该是所有的组合.我不知道什么是性格,所以如果你能解释一下,那会有所帮助.

With the code to get the power set, permutations are those of maximal length, the power set should be all combinations. I have no idea what dispositions are, so if you can explain them, that would help.

这篇关于PHP 中的组合、处置和排列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆