Adding vars in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mettlehead
Forum Newbie
Posts: 15
Joined: Fri Oct 11, 2002 11:03 am
Location: Canada

Adding vars in PHP

Post by mettlehead »

Hi, I seemed to work out all my problems so far but one. I have 3 variable that I want to add together when I send my email I tried this :

Total amount of order : $tot1+$tot2+$tot3

but the email just prints out "$tot1+$tot2+$tot3". How come I can't access the values in them?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

$totalamount = $tot1+$tot2+$tot3;
only $text = '$tot1+$tot2+$tot3';would result in your output.
Post Reply