extremely basic question - php

Discussion in 'PHP' started by kylexy, Mar 11, 2012.

  1. kylexy

    kylexy New Member

    Joined:
    Feb 21, 2012
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    can somebody explain me heredoc and newdoc syntax in a few words please ?
    i know it's so basic but since i have no idea ... it's hard 4 me. :embarasse
    it'd be extremely helpful to understand this...
     
  2. brillcareer

    brillcareer New Member

    Joined:
    May 18, 2015
    Messages:
    2
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Mohali
    Home Page:
    http://brillcareer.com
    hi Kylexy

    here is the syntax for heredoc
    <?php
    $str = <<<DEMO
    This is a
    demo message
    with heredoc.
    DEMO;

    echo $str;
    ?>
     
    shabbir and coderzone like this.
  3. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    0
  4. sheamus

    sheamus New Member

    Joined:
    Jul 2, 2016
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    astrology
    Location:
    jalandhar
    <?php
    $str = <<<DEMO
    This is a
    demo message
    with heredoc.
    DEMO;

    echo $str;
    ?>
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice