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 3280366
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:41:46+00:00 2026-05-17T19:41:46+00:00

How do put htmlcode in heredoc syntax. With in this HTML i May have

  • 0

How do put htmlcode in heredoc syntax. With in this HTML i May have some PHP Variables needs to be interpreted
and Some PHP loops needs to be executed .How Do i do all this can any one show an example

$con = <<<EOC
<style type="text/css">
.tddata {color:#330000;border-width:0px;font-family:Arial;font-size:12pt;font-weight:bold}
.tdheading {color:#FF0000;border-width:0px;font-family:Arial;font-size:12pt;font-weight:bold"}
</style>
</head>
<table border="0" width="500">
 <tr>
  <td colspan ="5" style="color:#FF0000;border-width:0px;font-family:Arial;font-size:12pt;font-weight:bold" nowrap>{ $_REQUEST ['SOMEPHP']; }</td>
  <td style="color:#FF0000;border-width:0px;font-family:Arial;font-size:12pt;font-weight:bold" nowrap>This report was created on <?php echo (date('d-M-Y')?></td>
 </tr>
</table>

<table border="1" width="700"> 
<tr>
<td class="tddata" bgcolor="#808080" colspan="1">Mode</td> 
<td class="tddata" bgcolor="#808080"><?php  echo $_POST['MODE'] ;?></td> 
<td class="tddata" bgcolor="#808080">Type</td> 
<td class="tddata" bgcolor="#808080" colspan="1"><?php  echo $_POST['TYPE'] ;?></td> 
</tr>
EOC
  • 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-17T19:41:46+00:00Added an answer on May 17, 2026 at 7:41 pm

    Remeber no space between { and $ when doing variable substitution. And the HEREDOC terminator (EOC in your case) must start on the first column and end with a semicolon.

    Try this:

    $date = date('d-M-Y');
    $con = <<<EOC
      <style>...</style>
      </head>
      <table border="0" width="500">
      <tr>
        <td colspan ="5" style="..." nowrap>{$_REQUEST['SOMEPHP']}</td>
        <td style="..." nowrap>This report was created on {$date}</td>
      </tr>
      </table>
    
      <table border="1" width="700"> 
      <tr>
        <td class="tddata" bgcolor="#808080" colspan="1">Mode</td> 
        <td class="tddata" bgcolor="#808080">{$_POST['MODE']}</td> 
        <td class="tddata" bgcolor="#808080">Type</td> 
        <td class="tddata" bgcolor="#808080" colspan="1">{$_POST['TYPE']}</td> 
      </tr>
    EOC;
    
    // loop example
    for ($i=0; $i < 10; $i++) {
        $con .= <<<EOC
            <p>{$i}</p>
    EOC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use HTML to put text into a JButton. In this way I can
Please tell me how i put html code in my iphone app i have
Put it another way: what code have you written that cannot fail. I'm interested
I put together a class yesterday to do some useful task. I started alpha
I have an HTML string from a Ajax loaded source. I would like to
I need to export a gridview to excel, I put the return html code
I have the following HTML code: <div style=background-image:url(~/Images/MyImage.jpg); width:100%; height:100%> I'm not too familiar
Often while coding view templates in html, my habit of adding some helpful comments
How can i put and an html form (text box and buttons) within an
Whenever display text in an HTML document I always put it through htmlentities 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.