PHP Programs

TheFestFever.com

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.

even_position.php

<!DOCTYPE html>  
<html>
<head>	
	<title>PHP Programs TutorialDuniya.com</title>
</head>
<body>  
	<?php  
	
		$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>");  
		} 
	?>
</body>  
</html>



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.