Re: global variable.
| From: | Goran Aleksic | Date: | Sat, 25 Aug 2001 16:24:47 +0000 |
| Subject: | Re: global variable. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64512@lists.php.net to get a copy of this message | ||
hi,
if I understand correctly...
you should try:
<?php
session_register ("a");
?>
include this line in files where you want to make your $a global
Goran
Hugh Bothwell <hugh_bothwell@hotmail.com> wrote in message
news:20010825150925.89514.qmail@pb1.pair.com...
>
> "Nafiseh Saberi" <nsaberi@iraninfocenter.net> wrote in message
> news:200108260756.f7Q7up228742@persia.iraninfocenter.net...
> >
> > hi.
> >
> > I want to use glabal variable.
> >
> > <?
> > global $a;
> >
> > ?>
> > but it doesnot work??
>
> ... why do you think you need to use global here?
>
> global is used *in a function* to let it see
> external variables. You are not in a function,
> so I don't see why you think you need it.
>
>