Einzelnen Beitrag anzeigen

Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#1

[PHP] Globale Variablen

  Alt 3. Jun 2006, 01:31
Morgen.

Noch ein Problem mit PHP.

Ich habe grade folgendes probiert:

Code:
global $blubb;

function foo() {
$blubb["abc"]="wuppdi";
}

function bar() {
echo($blubb["abc"]);
}

foo();
bar();
Was bekomme ich? Natürlich eine leere Ausgabe. Wäre sonst auch zu leicht gewesen.

Was mache ich da falsch? Welche Einstellung verbockt das?

Wenn ich statt $blubb["abc"] schreibe $GLOBALS["blubb"]["abc"] geht es seltsamerweise.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat