|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Maths
Hi,
I know how to add 1 to a variable (ie $cur++) But how do I add more than one? ie two? |
|
#2
|
||||
|
||||
|
RE: Maths
$cur += 2;
|
|
#3
|
|||
|
|||
|
RE: Maths
$cur = $cur + 2;
Sorry, couldn't help myself. |
|
#4
|
|||
|
|||
|
RE: Maths
Just thought of this question.
Is there short hand for pre-incrementing by a value greater than one? |
|
#5
|
|||
|
|||
|
RE: Maths
you could always create a function.
|
|
#6
|
|||
|
|||
|
RE: Maths
whops something lioke
function($val,$num) { $val += $num } but thats only if your going to us it alot |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Maths |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|