-
personal web page
PHP array_chunk() Function
<?php
$a=array("a"=>"Cat","b"=>"Dog","c"=>"Horse","d"=>" Cow");
print_r(array_chunk($a,2));
?>
Array (
[0] => Array ( [0] => Cat [1] => Dog )
[1] => Array ( [0] => Horse [1] => Cow )
)
Example 2
<?php
$a=array("a"=>"Cat","b"=>"Dog","c"=>"Horse","d"=>" Cow");
print_r(array_chunk($a,2,true));
?>
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks