Creative Solution
Creative Solution

Reputation: 89

Addition in php echo

Whats wrong with this code.i am getting this + 200 +.i just want addiiton in this.+ sign creating problem in echo

<?php echo "<div id=totalValu>Total Value: <span id=totalValue style=float:right>$ $beg + $int + $adv </span></div> "; ?>

Upvotes: 0

Views: 2110

Answers (1)

BenM
BenM

Reputation: 53198

You need to break out the addition from the string literal as follows:

<?php echo '<div id="totalValu">Total Value: <span id="totalValue" style="float:right">$'.($beg + $int + $adv).'</span></div>'; ?>

Upvotes: 4

Related Questions