<?php
$arr = array("A","B","C","D","E","F","G");
foreach (array_chunk($arr, 2) as $list) {
echo '<ul><li>' . implode('</li><li>', $list) . '</li></ul>' . PHP_EOL;
}
- Output for 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
- <ul><li>A</li><li>B</li></ul>
<ul><li>C</li><li>D</li></ul>
<ul><li>E</li><li>F</li></ul>
<ul><li>G</li></ul>
preferences:
43.26 ms | 407 KiB | 5 Q