Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:27:17+00:00 2026-06-08T12:27:17+00:00

I need to work with some scripts, in which I found this: $data =

  • 0

I need to work with some scripts, in which I found this:

$data = <<<DATA
MIN={$min}
INVOICE={$invoice}
AMOUNT={$sum}
EXP_TIME={$exp_date}
DESCR={$descr}
DATA;

Can someone provide more info around $somevar = <<<DATA… and echo <<<HTML… it seems hard to find useful info about this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:27:18+00:00Added an answer on June 8, 2026 at 12:27 pm

    It´s a heredoc syntax:

    Heredoc

    A third way to delimit strings is the heredoc syntax: <<<. After this operator, an identifier is provided, then a newline. The string itself follows, and then the same identifier again to close the quotation.

    The closing identifier must begin in the first column of the line. Also, the identifier must follow the same naming rules as any other label in PHP: it must contain only alphanumeric characters and underscores, and must start with a non-digit character or underscore.

    You can read more about this in the php documentation
    http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

    More info:

    Example:

    <?php
    $mystring = <<<EOT
    This is some PHP text.
    It is completely free
    I can use "double quotes"
    and 'single quotes',
    plus $variables too, which will
    be properly converted to their values,
    you can even type EOT, as long as it
    is not alone on a line, like this:
    EOT;
    ?> 
    

    There are several key things to note about heredoc, and the example above:

    You can use anything you like; "EOT" is just an example

    You need to use <<< before the delimiter to tell PHP you want to enter heredoc mode

    Variable substitution is used in PHP, which means you do need to escape dollar symbols – if you do not, PHP will attempt variable replacement.

    You can use your delimiter anywhere in the text, but not in the first column of a new line

    At the end of the string, just type the delimiter with no spaces around it, followed by a semi-colon to end the statement

    Without heredoc syntax, complicated string assignments can quickly become very messy. Heredoc is not used all that often in the wild – very often you will wish it were used more, because too many scripts you will come across have messy code as a result of not using heredoc!

    http://www.tuxradar.com/practicalphp/2/6/3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some graphics work I need to read in a large amount of data
That title may need some work. Perhaps after reading this, you may be able
I need a fresh temporary directory to do some work in a shell script.
I need to work with some old C++ code that was developed in Visual
I'm doing some work with registry hives, and I need to know if the
So for some research work, I need to analyze a ton of raw movement
Using C#, I need to do some extra work if function A() was called
I need some help with a work project I have been assigned. At the
I need some recommendations how to work better with the same sprites using Cocos2d.
I need some tips on how to work with assets in Symfony 2. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.