Re: Clearing Variable and Functions
- From: "Rik" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Sat, 27 May 2006 04:50:03 +0200
dimo414 wrote:
I have a script which needs to reset a series of variables several
times; I have a function setallvar() which first obtains all these
global variables, then sets them all. It's quite a tedious setup, but
quite useful to be able to basically unset them all like this. You
said this is poor form, what would you suggest instead, to mass-set
variables?
I'no real OO fan, but maybe that's a good answer is this case: create an
object with certain vars, with corresponding functions, and further on
create another object with different vars.
Then again, I'm used to initializing vars. Every variable which is used I
initiliaze somewhere in the script, prior to setting/using it. No chance it
has a wrong value, and an extra security measure, usefull for instace when,
heaven forbid, I'm working on a server with register_globals.
Grtz,
--
Rik Wasmus
.
- References:
- Clearing Variable and Functions
- From: MW
- Re: Clearing Variable and Functions
- From: dimo414
- Re: Clearing Variable and Functions
- From: MW
- Re: Clearing Variable and Functions
- From: dimo414
- Clearing Variable and Functions
- Prev by Date: Re: PHP/MySQL and Checkboxes
- Next by Date: Re: Regex pattern help
- Previous by thread: Re: Clearing Variable and Functions
- Next by thread: "<br>" v "<br\>"
- Index(es):