2tonejoe Posted August 4, 2008 Share Posted August 4, 2008 I am trying to echo variables plus text and it isn't working when the text is an underscore . . . $accountid = $row->accountID; echo <<<END <p class="account">$accountid_standard</p> END; The string is "_standard", but it doesn't print . . .? how can I ensure that the underscore isn't being read as a variable? Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/ Share on other sites More sharing options...
unidox Posted August 4, 2008 Share Posted August 4, 2008 $accountid = $row->accountID; echo "<p class="account">" . $accountid_standard . "</p>"; Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607051 Share on other sites More sharing options...
2tonejoe Posted August 4, 2008 Author Share Posted August 4, 2008 is there no way to do this inside of the: echo <<<END END; statement?? Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607056 Share on other sites More sharing options...
unidox Posted August 4, 2008 Share Posted August 4, 2008 Why do you need those? Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607058 Share on other sites More sharing options...
2tonejoe Posted August 4, 2008 Author Share Posted August 4, 2008 Why do you need those? because i plan on echoing much more that just that line of html. . its probably about 50 lines. Going through and formatting for each row to be echoed looks nasty and more time than its worth, but if it must be so . . . so be it Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607061 Share on other sites More sharing options...
PFMaBiSmAd Posted August 4, 2008 Share Posted August 4, 2008 Try the {} syntax to force php to reconize where the variable starts and stops - $accountid = $row->accountID; echo <<<END <p class="account">{$accountid}_standard</p> END; Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607070 Share on other sites More sharing options...
2tonejoe Posted August 4, 2008 Author Share Posted August 4, 2008 Try the {} syntax to force php to reconize where the variable starts and stops - $accountid = $row->accountID; echo <<<END <p class="account">{$accountid}_standard</p> END; that was the trick!!! THANKS! Link to comment https://forums.phpfreaks.com/topic/118006-solved-echo-ltltlt-problem/#findComment-607075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.