conditional statements inside php heredocs syntax?

i was wondering if you can have conditional statments inside a heredocs, this is my script but it deosnt parse out the $username properly?

php code:

function doSomething($username) {

if (isset($_SESSION['u_name'])){
$reply ='<a class ="reply" href="viewtopic.php?replyto=@$username.&status_id=$id&reply_name=$username"> reply </a>';

return <<<ENDOFRETURN

$reply

ENDOFRETURN;

the problem with this is the $username variable deosnt get rendered on the html. it remains $username :)) thanks

7
задан getaway 25 October 2010 в 05:58
поделиться