On Tue, 2003-03-11 at 14:43, Michael Ryan Byrd wrote:
> Frankly, it bugs the heck out of me that PHP searches through a string literal
> for variables. That is D-U-M dumb! Literals should be literals. Period.
In PHP, you can have it either way. It is often convenient to put
variables inside strings. If you want to do a string literal, use
single quotes. It's also faster that way, as it will not search for
$'s.
Can't we all just get along? :)
> In my opinion, you should *never* put a variable in double quotes and expect it
> to be interpreted as a variable. In anycase, it will screw you up when trying to
> do that with C,C++,Java, etc.
Of course. This is PHP, not C, C++, or Java.
> "../folder/navfile_".$variableA."_".$variableB.inc
Actually, you'd be better off with single quotes, as I mentioned above.
Alternatively, try this:
"../folder/navfile_${variableA}_${variableB}.inc"
PHP will parse that the way it was intended.
Steve
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list