Ninjakreborn Posted February 6, 2007 Share Posted February 6, 2007 What are the standard opinions on the heredoc statement. I never really liked the way they looked, but by investigating them further, you can throw $variables out in random places and it automatically detects the interpolation, also you don't have to escape double quotes. In your opinion is heredoc, single quotes, or double quote's better. Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/ Share on other sites More sharing options...
ShogunWarrior Posted February 6, 2007 Share Posted February 6, 2007 If you need to put some HTML or other data with lots of quotes into your script then heredocs are alot easier than escaping all the quotes. I wouldn't use them too often, but you usually don't need to. Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178653 Share on other sites More sharing options...
Ninjakreborn Posted February 6, 2007 Author Share Posted February 6, 2007 That is what I was thinking, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178657 Share on other sites More sharing options...
roopurt18 Posted February 6, 2007 Share Posted February 6, 2007 It took me a while to get to this point, but I like to break things down into small components that pop data in place using the <?=$var?> syntax. I also allow for simple and extremely limited logic / program control within components, but the idea is 99% of the time that is handled elsewhere and the component merely slaps data into place. As another general rule, I try and keep component files small; generally I can see the entire code contained in a component file without scrolling the text editor. Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178666 Share on other sites More sharing options...
corbin Posted February 6, 2007 Share Posted February 6, 2007 I hate herdoc mainly because I think it looks bad... I have no reason besides that though, so please just ignore my opinion lmao... Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178673 Share on other sites More sharing options...
roopurt18 Posted February 6, 2007 Share Posted February 6, 2007 Because it looks bad is a perfectly valid reason. Quote Link to comment https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178681 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.