2009/6/26 Michael <[email protected]>

>
> On Fri, 26 Jun 2009 20:28:18 Jochen Daum wrote:
> > Hi,
> >
> > On Fri, Jun 26, 2009 at 8:13 PM, Michael<[email protected]> wrote:
> > > We all know that we can make a static variable in to a global, but how
> do
> > > I make a dynamic variable into a global?
> > >
> > > I am calling a function (b), from with a function (a) and I want
> function
> > > b to have a dynamic value from function a IN THIS MANNER.
>
> Function b is called from within function a.
>
> In most instances function a needs 1 variable, which is easy - I just call
> it
> as f_b(v);
>
> However under one instance function b needs an additional variable.
>
> I thought I would just make this global and obtain it within function b as
> global var;
>
> except this doesn't work.
>
> Keep in mind this variable is a dynamic one obtained within function a.
>

What about setting up the function with a second parameter that is
predefined as an invalid value (Then you can appropriately deal with that
variable within b)

i.e:

function a($value1, $value2 = null){

...

}

Regards,
Wazzä

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to