php输出某字符串的所有不重复组合
function combination($str,$tmp){
$long = strlen($str);
if ($long == 0) $this->result[] = $tmp;
for ($i = 0; $i < $long; $i++)
{
$a=$str[$i];
$arr = str_split($str);
unset($arr[$i]);
$str2 = implode("",$arr);
unset($arr);
$this->combination($str2,$tmp.$a);
unset($str2);
}
}