//ads:
?>
I want to store data in new index as per my key in php [duplicate]
PHP Snippet 1:
$pieces = array_chunk($my_array, 6);
PHP Snippet 2:
<?php
$a = ["a","a","a","a","a","a","a","a"];
$b = array_chunk($a, 7);
echo"<pre>";print_r($b);
?>
PHP Snippet 3:
Array
(
[0] => Array
(
[0] => a
[1] => a
[2] => a
[3] => a
[4] => a
[5] => a
[6] => a
)
[1] => Array
(
[0] => a
)
)