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