<?php
$names = ['Robert', 'Adam', 'Magda'];
foreach ($names as $name) { // pobiera kolejne elementy tabel
echo $name . "<br />";
}
foreach ($names as $key => $name) { // inna forma: klucz => wartość
echo $key . " -> " . $name . "<br /> ";
}
PD9waHAKCiRuYW1lcyA9IFsnUm9iZXJ0JywgJ0FkYW0nLCAnTWFnZGEnXTsgCmZvcmVhY2ggKCRuYW1lcyBhcyAkbmFtZSkgeyAvLyBwb2JpZXJhIGtvbGVqbmUgZWxlbWVudHkgdGFiZWwKICBlY2hvICRuYW1lIC4gIjxiciAvPiI7Cn0KZm9yZWFjaCAoJG5hbWVzIGFzICRrZXkgPT4gJG5hbWUpIHsgLy8gaW5uYSBmb3JtYToga2x1Y3ogPT4gd2FydG/Fm8SHCiAgICBlY2hvICRrZXkgLiAiIC0+ICIgLiAkbmFtZSAuICI8YnIgLz4gIjsKfQ==