Hello everybody.. I've read about the "heredoc" way of outputting strings..
Where can we consider this use handy??
Is it used only to avoid escaping the single and double quotation mark??
Also, why is there an identifier to be put at the first and end of the function??
Thanks beforehand.
Pro2000
29
Posting Whiz
Recommended Answers
Jump to PostHeredoc syntax is a way to use custom identifier to delimit strings in PHP. Usualy string are delimited with single or double quotes, but with heredoc you declare (name) an identifier. This way you do not have to escape single and double quotes anymore. Te rules for chosing identifier name …
Jump to PostIt leaves the choice to the coder, because you might want to use E; in your output. By leaving this choice to you, you can make sure it is something that is not used in your output.
All 6 Replies
broj1
356
Humble servant
Featured Poster
Pro2000
29
Posting Whiz
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Pro2000
29
Posting Whiz
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Pro2000
29
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.