AW: [PHP-WIN] Functions and include files question?

From: Date: Thu, 10 Apr 2003 08:12:03 +0000
Subject: AW: [PHP-WIN] Functions and include files question?
Groups: php.windows 
Request: Send a blank email to php-windows+get-19381@lists.php.net to get a copy of this message
PHPs scoping sceme is unusual in that it does not automatically show global variables in a function. Use global $var1, $var2; to make visible those global variables you need in the respective function. -- Sven > -----Ursprüngliche Nachricht----- > Von: ODCS [SMTP:odcs@rogers.com] > Gesendet am: Donnerstag, 10. April 2003 07:06 > An: PHP Windows > Betreff: [PHP-WIN] Functions and include files question? > > I have a file with 20 or so error messages in it which gets included at the > top of a script. How can I work this so the variables inside the included > file are available to the various functions in the script. Right now I am > just re-including it in every function - it works, but there has to be a > better way to do this. Is there a way I can make the whole file global? > > TIA. > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#19381) next »