Chrome Extension

Split array into chunks using array_chunk() PHP

Breaking array into chunks of given size value.
<?php
    //IN CHUNKS OF 2
    $subjects = array("Math","Physics","Chemistry","English");
    print_r(array_chunk($subjects,2));
?>
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

PHP inbuilt function array_chunk() can be used to split the array into chunks of given size value.

Syntax

array_chunk($array, $size, hold_keys)

Search Index Data (The code snippet can also be found with below search text)

array_chunk() function PHP
Was this helpful?
0 Comments
Open Code Manager We are hiring