<<< text

This is a discussion on <<< text within the alt.comp.lang.php forums, part of the PHP Programming Forums category; What does the "<<<END" do? (from :http://justinvincent.com/home/articl...cleId=8&page=...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-13-2003
Double U
 
Posts: n/a
Default <<< text


What does the "<<<END" do? (from :http://justinvincent.com/home/articl...cleId=8&page=2)

<?php
$turkeys = “variables”;

print <<<END
It is nice to know that “you” can print any amount of text on
<font color=”red”>multiple</font> lines with <b>any</b>
character and still include $turkeys.
END;


?>

-W
Reply With Quote
  #2 (permalink)  
Old 12-13-2003
warstar
 
Posts: n/a
Default Re: <<< text

http://nl2.php.net/echo
RTFM


On Sat, 13 Dec 2003 14:54:12 -0500, Double U
<PleaseSpamMe@myEmail.com> wrote:

>
>What does the "<<<END" do? (from :http://justinvincent.com/home/articl...cleId=8&page=2)
>
><?php
>$turkeys = “variables”;
>
>print <<<END
>It is nice to know that “you” can print any amount of text on
><font color=”red”>multiple</font> lines with <b>any</b>
>character and still include $turkeys.
> END;
>
>
>?>
>
>-W


Reply With Quote
  #3 (permalink)  
Old 12-13-2003
John Dunlop
 
Posts: n/a
Default Re: <<< text

Double U wrote:

> What does the "<<<END" do? (from :http://justinvincent.com/home/articl...cleId=8&page=2)


The "<<<" tells us that heredoc syntax is used.
http://www.php.net/manual/en/language.types.string.php

By the way, I'd take whatever you read from that article with a pinch
of salt; on second thoughts, better make that a teaspoonful. I only
read the document you linked to, because I found it awfully yawn-
inducing, but I lost count of the mistakes and statements which may
lead well-intentioned folks astray.

For example, in heredoc syntax, the closing identifier ("END" in this
case) must be directly preceded by a newline. No other characters,
except an affixable semicolon, are allowed on that line.
Unfortunately the markup used in the article, more often than not,
causes indentation in a visual presentation, giving a misleading
suggestion that whitespace is permitted before the closing
identifier. That's simply not the case.

And, sorry, I can't resist mentioning the clueless use of "smart
quotes" in place of proper QUOTATION MARKs. They're meaningless in
both your posting and the article itself. It's not entirely obvious
who wrote the article and the last thing I want to do right now is
trawl through a site like that. Bah, humbug. ;-)

--
Jock
Reply With Quote
  #4 (permalink)  
Old 12-14-2003
Double U
 
Posts: n/a
Default Re: <<< text

Some time around Sat, 13 Dec 2003 21:07:54 -0000 (give or take a month), someone called John Dunlop
<john+usenet@johndunlop.info> rambled on about:
>
>By the way, I'd take whatever you read from that article with a pinch
>of salt; on second thoughts, better make that a teaspoonful. I only
>read the document you linked to, because I found it awfully yawn-
>inducing, but I lost count of the mistakes and statements which may
>lead well-intentioned folks astray.


When I was reading that on the site and then looking at the php.net manual it didn't make sense to me and I could not
get it to work. Which only frustrated me. I guess what confused me is I expected it to have "END>>>" to close it.
I confused the EOD statement at php.net to be similar to the EOL (End of Line) I learned programming by using Pascal,
COBOL (and even more obsolete languages) and PHP just has not clicked for me yet. Usually if I see an example and read
the manual I get it. Of course maybe I shouldn't try and understand this after working a 10-12 hour day where I am very
unhappy.

Thank you for your help and the little bit you said made me understand something else.

> Bah, humbug. ;-)

Well Happy Holidays anyway. If you care it was written by Justin Vincent who wrote the ezSQL functions.


-W
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:38 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0