mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-06 07:05:14 +01:00
Initiale Version
This commit is contained in:
27
Kapitel_2/Lektion_10/4_foreach.php
Normal file
27
Kapitel_2/Lektion_10/4_foreach.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
$person = [
|
||||
'vorname' => 'Max',
|
||||
'nachname' => 'Muster',
|
||||
'strasse' => 'Musterstraße 1'
|
||||
];
|
||||
|
||||
|
||||
foreach ($person as $wert) {
|
||||
var_dump($wert);
|
||||
echo '<br>';
|
||||
}
|
||||
|
||||
|
||||
echo '<ul>';
|
||||
foreach ($person as $wert) {
|
||||
echo '<li>' . $wert . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
|
||||
echo '<ul>';
|
||||
foreach ($person as $schluessel => $wert) {
|
||||
echo '<li>' . $schluessel . ': ' . $wert . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
Reference in New Issue
Block a user