-3

If I use the below code, I get the literal string <b> DATE: <?php echo $date; ?> </b> appended to content:

$content .= '<b> DATE: <?php echo $date; ?> </b>';
$pdf->writeHTML($content);

How can I instead get the value of $date there?

AD7six
  • 59,391
  • 12
  • 88
  • 120

1 Answers1

2

You are trying to put php code inside a string which will not be evaluated again. Try this:

$content .= '<b> DATE: ' . $date . '</b>';
$pdf->writeHTML($content);
rauberdaniel
  • 976
  • 9
  • 22