I don't think there is a way to do pull a variable into the local scope of a
function without passing it as a value to the function.  But you can always
do this..

myfunction() {
global $myarray;
//..use myarray..//
unset $GLOBALS['myarray'];
}

You're in no danger this way.

-Kevin

----- Original Message -----
From: "Anup" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 3:54 PM
Subject: [PHP] Friend of function??


> I want to use arrays (that are outside of a function) to be visible to a
> function. I understand that I must you global. But I was wondering is it
> possible to make it visible to only certain functions, similar to the
> 'friend' keyword in C (or C++ ?) ? The reason, is that I don't feel
> comfortable having globals, (I was brought up that way). Also, if you
> actually declare something global are there any disadvantages such as
> performance hits?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to