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

  • SEARCH
  • Home
  • 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 638085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:41:39+00:00 2026-05-13T20:41:39+00:00

$test= <<<EOF …. EOF; I have never see it before. What’s it used for?

  • 0
$test= <<<EOF

....

EOF;

I have never see it before. What’s it used for?

  • 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-05-13T20:41:40+00:00Added an answer on May 13, 2026 at 8:41 pm

    This is called HEREDOC syntax, which is a way to define strings, on multiple lines, with variable interpolation.

    Quoting the manual page:

    Heredoc text behaves just like a
    double-quoted string, without the
    double quotes. This means that quotes
    in a heredoc do not need to be
    escaped, but the escape codes listed
    above can still be used. Variables are
    expanded, but the same care must be
    taken when expressing complex
    variables inside a heredoc as with
    strings.

    (There is more to read, that I didn’t copy-paste from the manual page)

    And, as a very quick and simple example:

    $a = 'World';
    $string = <<<MARKER
    <p>
      Hello, $a!
    </p>
    MARKER;
    echo $string;
    

    It will give you this output:

    Hello, World!
    

    And this HTML source:

    <p>
      Hello, World!
    </p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this file: cat > test.txt <<EOF line one word line two
test.c: int main() { return 0; } I haven't used any flags (I am
I have the following code: get_list_a() { $MYSQL -B -u $USER --passwword="$PW" $DB1 <<EOF
I have the following code: get_list_a() { $MYSQL -B -u $USER --passwword="$PW" $DB <<EOF
I have a file configure.sh with following (it creates a test.sh file with configuration,
I have a question regarding the following code: while((c = getc(pFile)) != EOF) {
I have created the following test server using java: import java.io.*; import java.net.*; class
I am wondering how I can implement something like the following: test(){ cat>file<<'EOF' abc
I have a unit test that I'd like to write for a function that
I have a unit test that checks behavior on blocking and non-blocking sockets -

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.