aashcool198 Posted May 29, 2009 Share Posted May 29, 2009 I have made a page in html. now i want to display things using php scrip. Do i have to echo whole html code? if yes than do i have to put backslash before every double quote character of html code? Quote Link to comment https://forums.phpfreaks.com/topic/160155-solved-embed-html-code-in-php-script/ Share on other sites More sharing options...
JonnoTheDev Posted May 29, 2009 Share Posted May 29, 2009 No, you can either open and close php tags only where you require them or you can use the << EOH syntax as below <?php $html = <<< EOH <p class="header">This is some text</p> <p>$contentInAVariable</p> EOH; print $html; ?> Alternatively you could use a template engine to completely separate the logic from the view. http://www.smarty.net Quote Link to comment https://forums.phpfreaks.com/topic/160155-solved-embed-html-code-in-php-script/#findComment-845038 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.