This article describes how php converts a one-dimensional array to a two-dimensional array consisting of three consecutive values. it involves the use of array_slice functions, for more information about how to convert a one-dimensional array to a two-dimensional array consisting of three consecutive values, see the example in this article. We will share this with you for your reference. The details are as follows:
The running result is as follows:
Array ([0] => Array ([0] => aa [1] => bb [2] => cc) [1] => Array ([0] => dd [1] => ee [2] => ff) [2] => Array ([0] => gg [1] => hh [2] => ii ))
Key code:
$ Bbb [] = array_slice ($ aaa, $ I * 3, 3); // 3 is a group of three. if it is a group of two, 2 is a group of two.
I hope this article will help you with PHP programming.
For more articles about converting a one-dimensional array to a two-dimensional array consisting of three consecutive values, see php!