Menu
Hello all.
I’m using echo <<<EOT to simplify my effort to write html and js file output.
Sometimes, I need to calculate something in the midst of it and I’m wondering if there’s a way to perform such a calculation on the spot instead of having to do …
EOT;
echo (some calculation);
echo <<<EOT
Know what I mean?
So, let’s say (intending to be a .js file output) …
$something = 25;
echo <<<EOT
var jojo = $something * 4;
alert(jojo);
EOT;
… is there a way to pre-calculate “$something * 4” without having to end the <<<EOT output? Something short and sweet?
If not, no biggy.