<?php
$data=array('1','2','3','4','5','6','7','8','9','10','11');
foreach($data as $key=> $element){
if($key % 2 != 0){
echo $element.'<br />';
}
echo '<hr />';
}
?>
php foreach as key, how to make every two number as a group?
I want to output:
1,2
_____
3,4
_____
5,6
_____
7,8
_____
9,10
_____
11