你需要做:
<?php
$z = func($x);
echo <<<HTML
[HTML PARTS..]
<td colspan="2">its function: {$z} </td>
...
HTML;
?>
或者你不能使用heredoc:
<?php
// your php code
?>
[HTML PARTS..]
<td colspan="2">its function: <? $z = func($x); echo $z; ?> </td>
...
<?php
// your php code
?>