SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Adding value to var
-
Oct 3, 2001, 12:33 #1
- Join Date
- Nov 2000
- Location
- Belgium
- Posts
- 102
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Adding value to var
What is the correct syntax to add a value to a certain variable.
Ex. $A = $A + $var;
-
Oct 3, 2001, 12:44 #2
Hi!
Your example certainly works! There is a shortcut notation, however:
$A += $var;
This adds the content of $var to that of $A. The result is saved in $A as one might expect.
This also works alike for -= *= .= and possibly many others. It's also widely supported in different programming languages.
Atrus.Webmaster - Stefan Meier KG TABAKWAREN - Pfeifen, Premium-Zigarren, ... (_Ger)
-
Oct 3, 2001, 14:12 #3
- Join Date
- Nov 2000
- Location
- Belgium
- Posts
- 102
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanx, I'm not used to programming PHP or other languages that have the look of C.
I'm more active with Pascal/Delphi
-
Oct 3, 2001, 14:35 #4
Yeahh, when I was saying 'widely accepted' I was having PHP, Perl, C, Java, JS, etc in mind. I don't remember much Pascal anymore
Regards,
Atrus.Webmaster - Stefan Meier KG TABAKWAREN - Pfeifen, Premium-Zigarren, ... (_Ger)
Bookmarks