What is $form<<<POST

Thread Solved

Join Date: Jun 2009
Posts: 197
Reputation: ayesha789 is an unknown quantity at this point 
Solved Threads: 3
ayesha789's Avatar
ayesha789 ayesha789 is offline Offline
Junior Poster

What is $form<<<POST

 
0
  #1
Sep 29th, 2009
Please explain me and when we echo $form; then it shows. please explain this.

  1. $form=<<<POST
  2. <form method="post" action="">
  3. </form>
  4.  
  5. POST;

Thanks in Advance...
Ayesha
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 43
Reputation: edwinhermann is an unknown quantity at this point 
Solved Threads: 9
edwinhermann edwinhermann is offline Offline
Light Poster

Re: What is $form<<<POST

 
0
  #2
Sep 29th, 2009
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:

  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>
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 197
Reputation: ayesha789 is an unknown quantity at this point 
Solved Threads: 3
ayesha789's Avatar
ayesha789 ayesha789 is offline Offline
Junior Poster

Re: What is $form<<<POST

 
0
  #3
Sep 29th, 2009
Thanks. great.
Ayesha
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC