The following is a demo two-digit array. the number of arrays in $ arr is not fixed. To generate the following results. That is, every array in $ arr is a combination of intersection. {Code ...}
The following is a demo two-digit array. the number of arrays in $ arr is not fixed. To generate the following results.
That is, every array in $ arr is a combination of intersection.
$ Arr = array ('luxury 1', 'seaside 2'), array ('dog A', 'Dog B '), array ('hour 1 ', '2 hrs ', '3 hrs '));
Reply content:
The following is a demo two-digit array. the number of arrays in $ arr is not fixed. To generate the following results.
That is, every array in $ arr is a combination of intersection.
$ Arr = array ('luxury 1', 'seaside 2'), array ('dog A', 'Dog B '), array ('hour 1 ', '2 hrs ', '3 hrs '));
Function output ($ array, $ lead = '') {$ items = current ($ array); $ subArray = array_slice ($ array, 1 ); foreach ($ items as $ item) {if ($ subArray) {output ($ subArray, $ lead. $ item. '-');} else {echo $ lead. $ item. '\ n ';}}}
Why do all dogs A repeat once?