I was wondering why I can't do something like {number_format($row['my_number'])}
inside a Heredoc. Is there any way around this without having to resort to defining a variable like $myNumber
below?
Looked at http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc but found nothing.
CODE
foreach ($dbh -> query($sql) as $row):
$myNumber = number_format($row['my_number']);
$table .= <<<EOT
<tr>
<td>{$row['my_number']}</td> // WORKS
<td>$myNumber</td> // WORKS
<td>{number_format($row['my_number'])}</td> // DOES NOT WORK!
</tr>
EOT;
endforeach;