How can one effectively access individual arrays after using array_chunk in PHP?

After using array_chunk in PHP to split an array into smaller arrays, you can access the individual arrays by using their index in the resulting multidimensional array. For example, if you split an array into chunks of 3 elements each, you can access the first chunk using $chunks[0], the second chunk using $chunks[1], and so on.

// Splitting an array into chunks
$array = [1, 2, 3, 4, 5, 6];
$chunks = array_chunk($array, 3);

// Accessing individual arrays
$firstChunk = $chunks[0];
$secondChunk = $chunks[1];

// Outputting individual arrays
print_r($firstChunk);
print_r($secondChunk);