Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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++;
	}
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php
ADD COMMENT
Topic
Name
9+3 =