Using foreach to Iterate Over Arrays in PHP


Loop through each element in an array with foreach, ideal for associative arrays.

Source Code

foreach ($users as $user) {
    echo $user['name'] . "
"; }
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments