3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [[ [ [ "description1", "Description2" ], "Description3", [ "Description4" ] ], [ "Description5" ] ] ]; $result = []; $arr = array(['description1'], ['description2'], 'description3', 'description4', 'description5'); //example array_walk_recursive($arr, function($v, $k)use(&$result){ $result[] = $v; }); $result = array_chunk($result, 2); foreach($result as $v) { echo "<div>" . implode(" ", $v) . "</div>"; }
Output for 5.4.0 - 7.2.0
<div>description1 description2</div><div>description3 description4</div><div>description5</div>