PHP Programs

Our aim is to connect students from campuses all over Delhi by making them aware of all Technical, Cultural, Management fests, workshops, Seminars organized by every college in Delhi.

Join Us Now

Program 37: Write a program to print the elements of an array present on even position.


<!DOCTYPE html>  
	<title>PHP Programs</title>
		$arr1 = array(10, 20, 30, 40, 50);   
		print("Elements of given array present on even position: <br>");  

		for ($i = 0; $i < count($arr1); $i = $i+2) 
			print($arr1[$i] . "<br>");  

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.