The array is divided into two parts: one-dimensional array. Note that the key name is irregular and non-numeric: $ arrarray (wc & gt; 12, wssc & gt; 123, wac & gt; 142, w3c & gt; 124, wac & gt; 012, wsbsc & gt; 012c3, wac & gt; 014d2, w3ec & gt; 0124); it is divided into two parts: $ arr1arra array is divided into two parts
A one-dimensional array. Note that the key name is irregular and non-numeric:
$ Arr = array ('WC '=> 12, 'wssc' => 123, 'wac' => 142 ', w3c' => 124, 'wac' => 012, 'wsbsc '=> 012c3, 'wac' => 014d2', w3ec '=> 0124 );
It is divided into two parts:
$ Arr1 = array ('WC '=> 12, 'wssc' => 123, 'wac' => 142 ', w3c' => 124 );
And
$ Arr2 = array ('wac' => 012, 'wsbsc '=> 012c3, 'wac' => 014d2', w3ec '=> 0124 );
Find this algorithm
------ Solution --------------------
You didn't specify any splitting rules ――
Array_chunk ()
Or
Array_slice ()
------ Solution --------------------
The condition for splitting is obvious. you can determine whether the first character is 0.
Unfortunately, your question is wrong because the associated key wac is repeated. Therefore, the array $ arr has only 7 items.
Seven items are split into an array of eight items in total. due to insufficient conditions, there is no solution!
Aren't you challenging our IQ?
------ Solution --------------------
No matter whether your array is correct or not, this method should be feasible (an even number of elements; or an odd number, with at least one cent ):
Asort ($ arr );
Then, extract the previous one and click OK. For intercept, you can use a function or assign a value to another array.