> I would suggest not to use $hash[var1][var2] instead of
> $hash['var1']['var2'] because afaik php will think u mean two constants
> ( var1 and var2 ).
> Just if it doesnt find these constants it will use them as
> $hash['var1']['var2'].

Thats correct, php will think they are constants and upon not finding them
will send up a low priority error (I think its of E_NOTICE). Appologies for
sloppy coding (must remember to be more awake).

$hash['var1']['var2'] is much better, safer, more compatable and faster
(marginally - as it doesnt have to check for constants of that name). As an
extra note, (and this of personal desire rather than coding standards), I
would always break out of a string to insert variables. Personally it just
highlights the dynamic parts of string creation.

eg: = "Name: ".$user->name." is age ".$user->age.". ".(($user-
>birthday==$today)?"Happy Birthday!")."<br />";

but thats getting out of the scope of the question heh

Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to