Use the php algorithm to separate arrays without array_chunk (). Use the php algorithm to split the array, instead of using array_chunk () to separate the array, rather than using the php algorithm (). The algorithm is shown below. $ Value) {whether this value exists if (! Isset ($ newarray [$ I] an array separated by the php algorithm, without the use of array_chunk ()
Use the php write algorithm to split the array without using array_chunk (). The algorithm is as follows.
$ Value) {// whether this value exists if (! Isset ($ newarray [$ I]) {$ newarray [$ I] = array ();} if (count ($ newarray [$ I]) <$ size) {// first-identified problem if ($ preserve_keys = false) {$ newarray [$ I] [] = $ value ;} else {$ newarray [$ I] [$ key] = $ value ;}} else {$ I ++; if ($ preserve_keys = false) {$ newarray [$ I] [] = $ value;} else {$ newarray [$ I] [$ key] = $ value ;}} return $ newarray ;} $ array = array (1, 2, 3, 4, 5, 6, 7); print_r (array_chunk_list ($ array, 2, true ));
The http://www.bkjia.com/PHPjc/892831.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/892831.htmlTechArticlephp algorithm of the split array, do not use array_chunk () write algorithm to split the array, do not use array_chunk (); the algorithm is as follows. $ Value) {// whether this value exists if (! Isset ($ newarray [$ I]...