[EMAIL PROTECTED] (John Hughes) wrote:

 > Can someone point me toward a tutorial on the proper use of global
 > references under PHP4. 
>
 > I have been declaring 
>
 > function something()
 > {
 > global $foo, $bar; 
>
 > /* some actions */
>
 > }
>
 > in functions and I understand that this is not the way I'm supposed
 > to be doing this. Or there is a new way that is preferred.

you can do it that way, but if you want to avoid calling global all
the time you might consider this approach:

$GLOBALS["foo"] = 123;

function something()
{
    echo $GLOBALS["foo"];
}

-- 
Henrik Hansen

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

Reply via email to