日期:2014-05-17 浏览次数:20487 次
printStr(str_split('012')); function printStr($arr, $length = 4, $str = '') { if(empty($arr) || !is_array($arr)) { return; } foreach($arr AS $k=> $v) { $str .= $v; if(strlen($str)<$length) { $temp = $arr; unset($temp[$k]); printStr($temp, $length, $str); } else { echo $str . '<br />'; } $str = substr($str, 0, -1); } }