It is required to implement an array of seven elements, retrieve the Five Elements in the array, and generate a new array. These arrays are unique.
It is required to implement an array of seven elements, retrieve the Five Elements in the array, and generate a new array. These arrays are unique.
The Code is as follows:
$ Arr = array (1, 2, 3, 4, 5 );
/*
@ Res each element of each injection assembled
@ $ A temporary Array
@ $ Index Array index
@ $ Arr requested Array
@ $ B the final result
*/
$ A = array ();
$ B = array ();
$ Total = 0;
Format ($ a, 0, $ arr );
Function format ($ res, $ index, $ arr ){
Global $ total;
Global $ B;
$ New_arr = $ res;
$ N_arr = array ();
If ($ index = count ($ arr )){
If (count ($ new_arr) = 5 ){
$ B [] = $ new_arr;
Echo"
";
$ Total ++;
}
Return;
}
Format ($ new_arr, $ index + 1, $ arr );
$ New_arr [] = $ arr [$ index];
Format ($ new_arr, $ index + 1, $ arr );
}Echo"
";
Print_r ($ B );
Echo"
";
,