3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $name=array("raj","ram","pooja"); $rel=array("brother","father"); $array=array(); for($i=0;$i<sizeof($name);$i++) { if($i<(sizeof($name)-1)) { echo "".$name[$i]." ".$rel[$i]." ".$name[$i+1]."<br>"; $arrays = $name[$i]." ".$rel[$i]." ".$name[$i+1]; array_push($array, $arrays); } } print_r($array);
Output for 4.3.0 - 7.1.0
raj brother ram<br>ram father pooja<br>Array ( [0] => raj brother ram [1] => ram father pooja )