for php
<?php
$fruits = ["apple", "banana", "orange"];
for ($i = 0; $i < count($fruits); $i++) {
echo "Index of ".$i."= ".$fruits[$i]."<br>";
}
// or
$i = 0;
foreach ($fruits as $value) {
echo "Index of ".$i."= ".$value."<br>";
$i++;
}
?>