JSHINER Posted April 8, 2008 Share Posted April 8, 2008 Which method is better? Does it even make a difference? <?php if(isset($_GET['var'])) { ?> Some stuff goes here. <?php } ?> vs. <?php if(isset($_GET['var'])) { echo 'Some stuff goes here.'; }?> Link to comment https://forums.phpfreaks.com/topic/100207-solved-quick-question-about-echo-vs-not-echoing/ Share on other sites More sharing options...
p2grace Posted April 8, 2008 Share Posted April 8, 2008 The first way you'd wouldn't have to worry about quotes. You wouldn't have to worry about quotes the second way either if you used heredoc. Link to comment https://forums.phpfreaks.com/topic/100207-solved-quick-question-about-echo-vs-not-echoing/#findComment-512381 Share on other sites More sharing options...
discomatt Posted April 8, 2008 Share Posted April 8, 2008 Jumping in and out of PHP isn't recommended. Avoid it unless you're dealing with large blocks of HTML... and even then, you've always got the HEREDOC syntax. Link to comment https://forums.phpfreaks.com/topic/100207-solved-quick-question-about-echo-vs-not-echoing/#findComment-512412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.