[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

<<EOT PHP

Posted on 2010-11-15
5
Medium Priority
?
1,152 Views
Last Modified: 2012-05-10
What is <<EOT and what are the advantages/usage of it in php ?
0
Comment
Question by:sahanz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34136164
check out the HEREDOC syntax of php:
http://php.net/manual/en/language.types.string.php
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 34136208
Example:

$money = 100.00;
$thing = <<<ENDTHING
In here you can put anything you want - lots of lines of HTML, for example.
You can substitute values, for example, $money
ENDTHING;

echo $thing;
0
 
LVL 5

Assisted Solution

by:innotionent
innotionent earned 500 total points
ID: 34145206
http://onlamp.com/pub/a/php/2003/04/10/php_heredocs.html

here is a decent explanation.
I don't use it myself. However apparently it's an easier way to mix alll your code together.
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 34145427
Although I have not verified it, this looks like an interesting note.
http://www.php.net/manual/en/language.types.string.php#86365

I find it incredibly useful when you want to separate your code and data from your presentation layer.  You create the values for all your variables, like the $money var in the post at ID:34136208, then you echo a HEREDOC string with the embedded variable names.  In some cases, your HEREDOC string can be the HTML of the entire web page.  Very  nice encapsulation!
0
 
LVL 1

Author Closing Comment

by:sahanz
ID: 34179723
Thank You
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question