The following code shows how to Create an Indexed Array in PHP.

<?php
$arr=array(12, 10, 9, 45, 'abc', 3.992, 6.8 -100);
$n=count($arr);
echo 'Array elements displayed using for loop....<br>';
for($i=0;$i<$n;$i++)
{
	echo $arr[$i].'<br>';
}
echo '<br>Array elements displayed using foreach loop....<br>';
foreach($arr as $k)
{
	echo $k.'<br>';
}
?>

Output

How to Create an Indexed Array in PHP
How to Create an Indexed Array in PHP

Further Reading

Examples of Array Functions in PHP

Basic Programs in PHP

Registration Form Using PDO in PHP