You are not logged in.

wcf.regNote.message

Opi62

Trainee

  • "Opi62" started this thread

Posts: 91

Location: 127.0.0.1

  • Send private message

1

Friday, October 30th 2009, 3:03pm

Für eine get variable einen array benutzen

Hi Ich habe mal wieder ein Kleines Problehm.
Bevor ich es genauer erleutere erstmal hier Der code

PHP Source code

1
2
$array = array("array1" => "Text ausgabe 1""array2" => "Text ausgabe 2");
echo $_GET["$array"];


Und zwar möchte ich wenn ich zum Beispiel über die url dann ?array1 aufrufe
das mir dann der text Text ausgabe1 ein ausgen wird.

Leider bin ich bis jetzt noch nicht so richtig dahinter gekommen.
und bei php.net habe ich leider auch nix Richtiges gefunden.

Schonmal danke für eure Hilfe.

Gruß Opi62

ShaoKhan

www.Spiegelwelt.com

Posts: 393

Location: 127.0.0.1

Occupation: EDV Dienstleister

  • Send private message

2

Friday, October 30th 2009, 3:24pm

Source code

1
2
3
foreach ($_GET as &$arr) {
	echo $arr;
}


könnte so funktionieren
Leben heisst - Narben tragen.

Opi62

Trainee

  • "Opi62" started this thread

Posts: 91

Location: 127.0.0.1

  • Send private message

3

Friday, October 30th 2009, 3:36pm

Leider Funktioniert das nicht.

Und mit var_dump(); Erhalte ich nur ein leeren array.


Aber troz dem danke für deinen Vorschlag.

Opi62

Trainee

  • "Opi62" started this thread

Posts: 91

Location: 127.0.0.1

  • Send private message

4

Friday, October 30th 2009, 4:11pm

Manchmal bin ich aber auch wie Verborrt.

Des Retsels lösung ist diese

PHP Source code

1
2
3
4
$arr = array("test"  => "hallo test ",
             "test2" => "test hallo");

echo $arr["".$_GET["seite"].""];



Ich hoffe mal das es anderen Leuten auch Helfen wird Falls mann sowas mal benötigt.

Gruß Opi62