Re: $name = "My $row['name']" not longer possible?
| From: | Matt Williams | Date: | Tue, 02 Jul 2002 13:45:05 +0000 |
| Subject: | Re: $name = "My $row['name']" not longer possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104907@lists.php.net to get a copy of this message | ||
On Tuesday 02 July 2002 13:49, Uwe Birkenhain wrote:
> Hi,
> I upgraded to 4.2 and now I get those errormessages
> "Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
> T_STRING or T_VARIABLE or T_NUM_STRING in ..."
>
> when doing sth like:
> $name = "My $row['name']";
>
Try
$name = "My {$row['name']}";
or
$name = "My ".$row['name'];
AFAIR you can't use array variables straight within strings.
Maybe I'm just about to be proved wrong :)
matt