ternary operator in heredoc string
| From: | dev lamp | Date: | Sat, 31 Dec 2005 14:43:47 +0000 |
| Subject: | ternary operator in heredoc string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-228060@lists.php.net to get a copy of this message | ||
Hi
I am trying to use the ternary operator inside heredoc string
to select the bgcolor based on the flag value, but it
does not seem to work.
$summary=<<<STR
<table width=100%>
<tr>
<td bgcolor={$reqstat ? green : red;}>$reqno</td>
</tr>
</table>
STR;
I looked up php documentation but could not find any details.
What would be an optimal way to write the code for the above situation ?
thanks
Dev.