Re: Global value
| From: | php3 at developersdesk dot com | Date: | Mon, 25 Sep 2000 01:50:53 +0000 |
| Subject: | Re: Global value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17476@lists.php.net to get a copy of this message | ||
Addressed to: "Roman A.Grigorovich" <atz@atz.msk.ru>
php-general@lists.php.net
** Reply to note from "Roman A.Grigorovich" <atz@atz.msk.ru> Wed, 20 Sep 2000
23:52:06 +0400 (MSD)
>
> Help me please! I am lost in documentation.
>
> Can I declare $var1 as global varaible for all functions in my
> .php-script?
>
Yes, just add
global $var1;
at the top of all functions in your script, at least the ones that need
access to the variable.
No, you can't do anything to a variable that makes it global all over. Look
at the global declaration in each function as the list of global variables
it accesses.
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com