Jump to content

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,


windjohn

Recommended Posts

Any idea what the problem with this line of code is:

 

if ($image = @getimagesize ("./images/$row['image_name']")) 

 

error displayed is Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

 

Thanks

 

John

if ($image = @getimagesize ("./images/{$row['image_name']}")) 

 

if you're using an array or anything more than just a var in a double quotes wrap it in parenthesis { and }

 

{ } are curly braces.

( ) are parentheses.

[ ] are brackets.

 

Just letting you know. ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.