both work? (was Re: [PHP] quick question)

From: Date: Fri, 11 Jan 2002 18:52:18 +0000
Subject: both work? (was Re: [PHP] quick question)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80229@lists.php.net to get a copy of this message
On Friday, January 11, 2002, at 06:05 AM, Ford, Mike [LSS] wrote:
Incidentally, I've occasionally had problems including a variable name containing an underscore in a double-quoted string (e.g. "$num_recs records retrieved"), where PHP tries to insert the value of $num followed by the string "_recs", so I always {} those as well, just to be on the safe side ("{$num_recs} ..." or "${num_recs} ..." both work.
You mentioned that {$num_recs} and ${num_recs} both work -- I'm familiar with the second form from bash shell scripting, but not the first. Do they both work in all instances, or is one "preferred" over the other? Thanks Mike And sorry for making you repeat yourself (the first email I sent was incomplete but for some reason got sent, which you replied to and then the second, intended, email went out and that is when you wrote your second reply :). I have a better understanding of using associative indexes from arrays in double-quoted statements now. Erik

« previous php.general (#80229) next »