WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 23.09.2003, 00:05   #1
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard Php Variablen

Wie kann man in PHP aus einer Unterfunktion heraus auf die Variablen einer aufrufenden Funktion zugreifen? Geht das überhaupt?

Im Untenstehenden Beispiel kommt im Moment als output "wasanderes" heraus. D.h. das Unterprogramm ändert die Variable $was nur temporär bzw. erzeugt anscheinend eine lokale Variable.
Code:
<?php
$was="anderes";
function irgendwas()
 {
 $was="was";
 echo $was;
 }
irgendwas();
echo $was;
?>
Jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 11:56 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag