Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Split an array into chunks of two and preserve the original keys:
SUBMITTED BY:
henry1874w
DATE:
June 22, 2017, 12:08 a.m.
FORMAT:
Text only
SIZE:
115 Bytes
Raw
Download
Tweet
HITS:
326
Go to comments
Report
<?php
$age=array
("Peter"=>"35","Ben"=>"37","Joe"=>"43","Harry
"=>"50");
print_r(array_chunk($age,2,true));
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus