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