foochuck Posted June 25, 2009 Share Posted June 25, 2009 I'd like to echo a huge chunk of html on my page using PHP...is there a way to echo html rather than using the echo function? FOO Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/ Share on other sites More sharing options...
phant0m Posted June 25, 2009 Share Posted June 25, 2009 ?> html <?php Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863596 Share on other sites More sharing options...
foochuck Posted June 25, 2009 Author Share Posted June 25, 2009 I'm sorry I didn't explain to well...I'm using an if statement.... <?php if (a == b) { echo 'huge chunk of html goes here'; } Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863618 Share on other sites More sharing options...
947740 Posted June 25, 2009 Share Posted June 25, 2009 <?php if (a == b) { ?> HTML <?php } ?> OR <?php if (a == b) { echo <<<CONTENT HTML HTML HTML CONTENT; } ?> Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863620 Share on other sites More sharing options...
foochuck Posted June 25, 2009 Author Share Posted June 25, 2009 Thanks 947740 Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863621 Share on other sites More sharing options...
947740 Posted June 25, 2009 Share Posted June 25, 2009 No problem. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863626 Share on other sites More sharing options...
phant0m Posted June 25, 2009 Share Posted June 25, 2009 For the 2nd possibility posted by 947740, have a look here: http://ch.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863638 Share on other sites More sharing options...
StefanRSA Posted June 25, 2009 Share Posted June 25, 2009 How about putting the huge bunch of HTML in another php file and just use include? It was what I would have done? Or do I miss the point? Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863648 Share on other sites More sharing options...
WolfRage Posted June 25, 2009 Share Posted June 25, 2009 All of the methods will work, it really comes down to what his intentions are and what will be the most efficient for him. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863654 Share on other sites More sharing options...
947740 Posted June 25, 2009 Share Posted June 25, 2009 How about putting the huge bunch of HTML in another php file and just use include? It was what I would have done? Or do I miss the point? So you don't know what you would have done? Maybe he doesn't know how to includ files. Kind of hard to tell when he doesn't give us much info. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863656 Share on other sites More sharing options...
foochuck Posted June 25, 2009 Author Share Posted June 25, 2009 This method <?php if (a == b) { ?> HTML <?php } ?> will work the best for me...and yes I know how to do includes. Thanks everyone. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863673 Share on other sites More sharing options...
947740 Posted June 25, 2009 Share Posted June 25, 2009 ...and yes I know how to do includes. I hope you didn't take that the wrong way. I wasn't trying to insinuate that you were stupid or something, I just didn't know how much you have done PHP. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863676 Share on other sites More sharing options...
foochuck Posted June 25, 2009 Author Share Posted June 25, 2009 It's all good man It's my fault...I try to explain what I'm looking for and end up leaving out some of the most important stuff. Link to comment https://forums.phpfreaks.com/topic/163676-echo-a-huge-chunk-of-html/#findComment-863687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.