Rather than having the following scenario:
$GLOBALS['foo'] = 'foo';
$GLOBALS['fee'] = 'fee';
The following would be much cleaner and portable while still allowing
the ease of use of $GLOBALS based configuration:
$GLOBALS['myProjectName']['foo'] = 'foo';
$GLOBALS['myProjectName']['fee'] = 'fee';
Torben Wilson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 18, 2003 12:26 PM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Too much of $GLOBALS[] a problem??
On Thu, 2003-07-17 at 21:10, Ow Mun Heng wrote:
'Loosely-coupled' code relied much less on the environment around
Hi All,
Just a quick question on this. In my scripts, I'm using A LOT Of
$GLOBALS['my_parameter'] to get the declared values/string. 1 example below
:
function display_menu_html()
{
echo 'table class=width100 cellspacing=0'.\n;
echo 'tr'.\n;
echo \t.'td
Ow Mun Heng wrote:
This isn't really a Problem but.. is it bad programming practice?? Or I
should just write another function that can return the values/string?
I don't see why it would be, unless you don't like how it looks.
--
The above message is encrypted with double rot13 encoding. Any
Ow Mun Heng [EMAIL PROTECTED] wrote:
Hi All,
Just a quick question on this. In my scripts, I'm using A LOT Of
$GLOBALS['my_parameter'] to get the declared values/string. 1 example below
:
function display_menu_html()
{
echo 'table class=width100 cellspacing=0'.\n;
:05 PM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Too much of $GLOBALS[] a problem??
On Thu, 2003-07-17 at 18:35, Ow Mun Heng wrote:
Hi All,
Just a quick question on this. In my scripts, I'm using A LOT Of
$GLOBALS['my_parameter'] to get the declared values/string. 1
On Thu, 2003-07-17 at 18:35, Ow Mun Heng wrote:
Hi All,
Just a quick question on this. In my scripts, I'm using A LOT Of
$GLOBALS['my_parameter'] to get the declared values/string. 1 example below
:
The only real problem is if you ever want to use that code in anything
else. Using
On Thu, 2003-07-17 at 21:10, Ow Mun Heng wrote:
'Loosely-coupled' code relied much less on the environment around it.
It would typically receive its values through an argument list, array
of values it needs, or perhaps by being a method in a class which has
attribute values for all of the
8 matches
Mail list logo