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? 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. 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? ;/ 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 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! Link to comment https://forums.phpfreaks.com/topic/257746-benefit-of-heredoc/#findComment-1321048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.