Umgang mit Arrays
Moin zusammen,
erstmal sorry für den unpassenden Titel aber etwas treffenderes ist mir nicht eingefallen.
Ich habe folgendes Verständnisproblem im Umgang mit Arrays.
Ich versuche das mal an einem Bespiel
$test= "Hallo";
$test= "Welt";
foreach($test as $temp) {
print $temp;
}
Gibt ja aus HalloWelt
Soweit schön
$test[1]= "Hallo";
$test[2]= "Welt";
foreach($test as $temp) {
print $temp;
}
Macht das gleiche
Was ist aber wenn als Ausgabe haben wollen würde WeltHallo???
$test[2]= "Hallo";
$test[1]= "Welt";
foreach($test as $temp) {
print $temp;
}
Geht leider nicht...
Wie "macht man sowas"???
Gruß
Christoph
erstmal sorry für den unpassenden Titel aber etwas treffenderes ist mir nicht eingefallen.
Ich habe folgendes Verständnisproblem im Umgang mit Arrays.
Ich versuche das mal an einem Bespiel
$test= "Hallo";
$test= "Welt";
foreach($test as $temp) {
print $temp;
}
Gibt ja aus HalloWelt
Soweit schön
$test[1]= "Hallo";
$test[2]= "Welt";
foreach($test as $temp) {
print $temp;
}
Macht das gleiche
Was ist aber wenn als Ausgabe haben wollen würde WeltHallo???
$test[2]= "Hallo";
$test[1]= "Welt";
foreach($test as $temp) {
print $temp;
}
Geht leider nicht...
Wie "macht man sowas"???
Gruß
Christoph
Please also mark the comments that contributed to the solution of the article
Content-Key: 87786
Url: https://administrator.de/contentid/87786
Printed on: April 25, 2024 at 17:04 o'clock
4 Comments
Latest comment