$bar = 'abc';

 function foo() {
  global $bar;

  $bar = 'def';
 }

 foo(); 
 echo $bar; // def

http://www.php.net/manual/en/language.variables.scope.php

regards,
Philip Olson

On Tue, 25 Sep 2001, Peter wrote:

> Hi,
> 
> I am have a function in which I have created a  variable in it called
> $genpassword.
> 
> I find that I am unable to carry this variable over to the the other
> scripts to use because it is a local variable and its value exists only in
> the function.
> 
> Is there anyway that I can take the value in $genpassword, a local
> variable and change it into a global variable so that other scripts will
> recognize it?
> 
> Thanks.
> 
> Peter
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to