-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
  • 63,116
  • 12
  • 91
  • 123

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
  • 1,017
  • 9
  • 22