EchoFool Posted February 19, 2008 Share Posted February 19, 2008 I have a syntax error on a string im building using variables.. not sure how its meant to be done properly... this is the line: <?php $QuoteLine = '<div class='quotetop'>QUOTE</div><div class='quotemain'>'.$QuoteUsername.'<br>'.$QuoteMessage.'</div>'; ?> Parse error: syntax error, unexpected T_STRING on line 486 How is it meant to be ? Hope you can help Quote Link to comment Share on other sites More sharing options...
craygo Posted February 19, 2008 Share Posted February 19, 2008 you have to escape the single quotes. $QuoteLine = '<div class=\'quotetop\'>QUOTE</div><div class=\'quotemain\'>'.$QuoteUsername.'<br>'.$QuoteMessage.'</div>'; or use double inside the single $QuoteLine = '<div class="quotetop">QUOTE</div><div class="quotemain">'.$QuoteUsername.'<br>'.$QuoteMessage.'</div>'; Ray Quote Link to comment Share on other sites More sharing options...
revraz Posted February 19, 2008 Share Posted February 19, 2008 Use double quotes around the entire string instead of single. Quote Link to comment Share on other sites More sharing options...
duclet Posted February 19, 2008 Share Posted February 19, 2008 Since you do have string replacement within the string, you are better off using the double quotes. <?php $QuoteLine = "<div class='quotetop'>QUOTE</div><div class='quotemain'>$QuoteUsername<br />$QuoteMessage</div>"; ?> Quote Link to comment Share on other sites More sharing options...
EchoFool Posted February 19, 2008 Author Share Posted February 19, 2008 Well i made life slightly easier for myself using a BB function so now i put: $QuoteLine = '[quote]'.$QuoteUsername.'<br>'.$QuoteMessage.'[/quote]''; But it's not liking that either.. do i have to escape / symbol on the ? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 19, 2008 Share Posted February 19, 2008 You have an extra single quote at the end. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted February 19, 2008 Author Share Posted February 19, 2008 Good spot! Thanks everyone SOLVED Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.