53329 Posted September 9, 2008 Share Posted September 9, 2008 It's been bothering me. I know that anything that is now a valid character for a variable will end it but is there another way to do it? I hate having to keep defining extra variables to account for it. One example of this... $url="index.php?";//predefined a long time ago $newurl=$url."page=this"; echo <<<PAGE <a href="$newurl">My page</a> PAGE; or creating words $type="sand";//predefined a long time ago $newtype=$type."paper"; echo <<<PAGE <html> $newtype </html> PAGE; It gets to be a pain after a while. Quote Link to comment https://forums.phpfreaks.com/topic/123377-solved-define-a-heredoc-variable-end/ Share on other sites More sharing options...
53329 Posted September 9, 2008 Author Share Posted September 9, 2008 Nvm found it right after. {$var} was the answe. Quote Link to comment https://forums.phpfreaks.com/topic/123377-solved-define-a-heredoc-variable-end/#findComment-637257 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.