windjohn Posted December 9, 2008 Share Posted December 9, 2008 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 Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/ Share on other sites More sharing options...
gevans Posted December 9, 2008 Share Posted December 9, 2008 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 } Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-710134 Share on other sites More sharing options...
DarkWater Posted December 9, 2008 Share Posted December 9, 2008 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. Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-710139 Share on other sites More sharing options...
gevans Posted December 9, 2008 Share Posted December 9, 2008 Haha, cheers DarkWater. This is why I write code, my english is awful!! Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-710140 Share on other sites More sharing options...
windjohn Posted December 9, 2008 Author Share Posted December 9, 2008 Thanks Fellas Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-710226 Share on other sites More sharing options...
redarrow Posted December 9, 2008 Share Posted December 9, 2008 Or this way. <?php if ($image = @getimagesize ("./images/".$row['image_name']." ")){}?> Link to comment https://forums.phpfreaks.com/topic/136150-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-710233 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.