unemployment Posted June 8, 2011 Share Posted June 8, 2011 Why is this not proper syntax $s = '<a href=\"../u/' echo $r['feedusername'];'\">' Link to comment https://forums.phpfreaks.com/topic/238784-php-syntax-error/ Share on other sites More sharing options...
Pikachu2000 Posted June 8, 2011 Share Posted June 8, 2011 You need to terminate the variable assignment with a semicolon before continuing on to echo anything. If you're trying to assign the value of $r['feedusername'] as well, you need the concatenation operator, not echo. Link to comment https://forums.phpfreaks.com/topic/238784-php-syntax-error/#findComment-1226953 Share on other sites More sharing options...
KevinM1 Posted June 8, 2011 Share Posted June 8, 2011 Because it's not? You have two options - use double quotes and have the variable value automatically substituted for you, like: $s = "<a href='../u/{$r['feedusername']}'>"; Or use single quotes and concatenation: $s = '<a href="../u/' . $r['feedusername'] . '">'; Link to comment https://forums.phpfreaks.com/topic/238784-php-syntax-error/#findComment-1226957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.