The title of the character combination type is as follows: there is a character set, such as: 0123456789. now you need to use any character in it to form a four-character string, with a total: 10*9*8*7 calculation results. how can I output these characters now? thank you .., PHPcodeprintStr (str_split ('012'); functionprintStr (subject of character combination type)
The questions are as follows:
There is a string of character sets, such as: 0123456789. now we need to use any of these characters to form four character strings. There are 7 types of computing results: 10*9*8, how can I output these characters now? thank you ..
------ Solution --------------------
For reference only
PHP code
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.'
';}$ Str = substr ($ str, 0,-1 );}}