Briser le long tableau en php


To reverse an array_chunk, use array_merge, passing the chunks as a variadic:

<?php
$array = [1, 2, 3, 4, 5, 6, 7, 8, 9];

$chunks = array_chunk($array, 3);
// $chunks = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

$de_chunked = array_reduce($array, 'array_merge', []);
// $de_chunked = [1, 2, 3, 4, 5, 6, 7, 8, 9]
?>

Powerful Pintail