Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php foreach

$myArray = [1,2,3];

foreach ($myArray as $item) {
    echo $item;
}

$myAssocArray = [1=>'One',2=>'Two',3=>'Three'];

foreach ($myAssocArray as $key => $value) {
    echo $key . ' is ' . $value;
}
Source by phpf1.com #
 
PREVIOUS NEXT
Tagged: #php #foreach
ADD COMMENT
Topic
Name
9+3 =