Re: How Do I make Global Scope Variables Available to Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28.05.2018 at 02:46, John wrote:

> I am writing a PHP script that has a number of variables that (I think) are in
> Global scope; that is, they are defined inline before the first command of the
> script.  Note that these are not necessarily constants as shown in the example I
> included; most of them can be changed by the script.
> 
> I have functions defined following these variables and before the commands in
> the script appear, but when they are called, the functions report the variables
> as undefined.  This means I have to pass all the Globals to each function as a
> call argument.  
> 
> This seems odd but I don't see what I am doing wrong.  Any suggestions?

See
<http://php.net/manual/en/language.variables.scope.php#language.variables.scope.global>.

-- 
Christoph M. Becker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux