943,935 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 468
  • PHP RSS
Sep 29th, 2009
0

What is $form<<<POST

Expand Post »
Please explain me and when we echo $form; then it shows. please explain this.

PHP Syntax (Toggle Plain Text)
  1. $form=<<<POST
  2. <form method="post" action="">
  3. </form>
  4.  
  5. POST;

Thanks in Advance...
Similar Threads
Reputation Points: 17
Solved Threads: 6
Posting Pro in Training
ayesha789 is offline Offline
485 posts
since Jun 2009
Sep 29th, 2009
0

Re: What is $form<<<POST

That's a short way of assigning a variable a value that spans multiple lines and includes special characters that would normally interfere with the PHP language.

It's called NOWDOC (see http://www.php.net/manual/en/languag....syntax.nowdoc)

Consider this example:

php Syntax (Toggle Plain Text)
  1. $text = <<<SPECIAL_LABEL
  2. The quick brown
  3. fox jumps over
  4. the lazy dog.
  5. SPECIAL_LABEL

This assigns the sentence (including line breaks) to the variable $text.

The syntax is:

$variable = <<<LABEL
contents go here....
LABEL

So, in your example, the value stored in $post is:

<form method="post" action="">
</form>
Reputation Points: 52
Solved Threads: 27
Junior Poster
edwinhermann is offline Offline
134 posts
since Sep 2009
Sep 29th, 2009
0

Re: What is $form<<<POST

Thanks. great.
Reputation Points: 17
Solved Threads: 6
Posting Pro in Training
ayesha789 is offline Offline
485 posts
since Jun 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: chained select boxes
Next Thread in PHP Forum Timeline: Joomla help!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC