Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

function in hereDocs

Is it possible to call a function from inside a heredoc?

For example, if I wanted to call date('Y-m-d', $rwTrans['dateTime']) inside the heredoc:-
    echo <<<EOD
      <tr data-transID="{$rwTrans['transID']}">
        <td>{date('Y-m-d', $rwTrans['dateTime'])}</td>
        <td>$transNote</td>
        <td>{$rwTrans['amount']}</td>
        <td>{$rwTrans['status']}</td>
      </tr>
EOD;

Open in new window


Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial