Would it be simpler to just have the second variable passed to f_b preset to null or default - to handle the times two variables are passed rather than messing around with globals
e.g function f_b( a, b=null) so you can do f_b(x) or f_b(x,y) -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Michael Sent: Friday, 26 June 2009 8:41 To: [email protected] Subject: [phpug] Re: PHP global variables 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. please consider the environment before you print this email ########################################################################################## The views expressed in this e-mail and any corresponding attachments do not necessarily reflect those of the Health Research Council of New Zealand. This e-mail together with any accompanying attachments may be confidential and subject to legal privilege. If you have received this message in error, please notify the sender immediately and note that you may not copy, disclose or use the content in any way Thank You. ########################################################################################## --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
