Jump to content

I unable to echo date in HTML table


Texan78
Go to solution Solved by PravinS,

Recommended Posts

Hello all, I am having trouble doing something I am familiar with and do all the time but for some reason it is not working in this instance. I have tried many different combinations to echo the date in a table cell. The problem is NOT with the php for the date as I am familiar with date formating. Problem I am having is it is not showing up when I echo and it gives me a parsing error. I have tried it many different ways. With and without double quotes, with and without single quotes, without quotes all together. without single quotes before and after like it is now. Whatever I try it just doesn't want to echo the date. I am not sure what I am missing. Maybe I just need an extra set up eyes. I know this is a really simple issue I am just having a brain fart.

 

 

This is the actual line.

<td style="font-size: 100%;"><b>Weather History for' echo date("D M jS"); '</b></td>

This is a snippet from where the code is from.

// FULL HISTORY TABLE
$fullHistory = '
<!-- Start Weather History -->
<div class="NWSround">
<table width="640px" text-align="center" cellpadding="0" cellspacing="0" style="margin:4px 11px 0px 11px;">
 <tr>
  <td style="font-size: 100%;"><b>Weather History for' echo date("D M jS"); '</b></td>
 </tr>
 <tr>
  <td> </td>
 </tr>';
$yearCount = count($historicalData);     // count keys in the array
for ($i = 0; $i < $yearCount; $i++){     // for each key, print the date and description
	$fullHistory .= " <tr>\n";
	$fullHistory .= "  <td style=\"text-align:justify; font-size: 12px;\">\n";
	$fullHistory .= $historicalData[$i]."<br /><br />\n";
	$fullHistory .= "  </td>\n";
	$fullHistory .= " </tr>\n";
}
$fullHistory .=
' <tr>
  <td>
   <span style="font-size: 9px;">'.$credited.'</span>
  </td>
 </tr>
</table>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><img alt="" src="images/1pixel.gif" border="0" height="7" width="7"></td><td class="shadow-mid" width="100%"><img alt="" src="images/1pixel.gif" border="0" height="7" width="7"></td><td><img alt="" src="images/1pixel.gif" border="0" height="7" width="7"></td></tr></tbody></table>


'.$notes.'<!-- End Weather History -->
';

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.