>  Is it possible for function1() to access the variables that were defined
in the function2() namespace?

Must be defined with global construct, as you did in function1()

-----Original Message-----
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 9:52 AM
To: PHP General
Subject: [PHP] Is it possible to...


Given the following code:

<script language="php">

  function function1() {
  
    global $bob;
    
    echo "Bob = $bob\n";
  
  }

  function function2() {
  
    $GLOBALS[bob] = "Joe Bob Briggs";
    
    function1();
  
  }
  
  function2();

</script>

function1() can echo out the value of $bob because it is
added to the global namespace in function2().  Is it possible
for function1() to access the variables that were defined in
the function2() namespace?  Like some sort of "limited"
global or something?  Something to allow called functions
access to the variable namespace of the calling function?

thnx,
Chris


-- 
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