www.webdeveloper.com
Results 1 to 3 of 3

Thread: <<<EndDoc

  1. #1
    Join Date
    Jan 2007
    Posts
    187

    <<<EndDoc

    hey, I noticed this in some php code recently, and I noticed two different ways to do it.

    $var = <<<EndDoc
    type whatever here
    EndDoc;

    and

    $var = <<<XML
    type xml here
    XML;

    Ive never seen this before but Im guessing you can use any string after <<< and you close it by calling that string again. Does anyone know what this is called? I cant find any information about it.

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    its called heredoc syntax
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  3. #3
    Join Date
    Jan 2007
    Posts
    187
    ah thanks a lot. I was wondering why it wasnt working for me, guess you cant put tabs before the identifier.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles