3raser Posted February 25, 2012 Share Posted February 25, 2012 I noticed someone using heredoc in a project of theirs, somewhat like this: <?php $var = 'really'; $txt = <<<TEST This is $var cool! TEST; echo $txt; ?> What's the use/benefit of using heredoc? Quote Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/ Share on other sites More sharing options...
darkfreaks Posted February 25, 2012 Share Posted February 25, 2012 it's much cleaner to use when using Queries and you don't have to use quotes or escape stuff. Quote Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/#findComment-1321045 Share on other sites More sharing options...
3raser Posted February 25, 2012 Author Share Posted February 25, 2012 Can you show an example? ;/ Quote Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/#findComment-1321046 Share on other sites More sharing options...
darkfreaks Posted February 25, 2012 Share Posted February 25, 2012 http://www.tuxradar.com/practicalphp/2/6/3 Quote Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/#findComment-1321047 Share on other sites More sharing options...
3raser Posted February 25, 2012 Author Share Posted February 25, 2012 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/#findComment-1321048 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.