<?php $x=array(1,2,3,4,5,6); foreach($x as $y) { print_r($y); } ?>
$x=array(1,2,3,4,5,6); $temp = ""; foreach($x as $y) { if($temp !== "") { print_r("(".$temp.",".$y.")"); $temp = ""; } else { $temp = $y; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)