variables Flashcards
1
Q
add a value to a variable
A
$x += 10;
2
Q
subtract a value from a variable
A
$x -= 10;
3
Q
increment the value of a variable by 1
A
++$x;
4
Q
decrement the value of a variable by 1
A
–$y;
5
Q
if (++$x == 10) echo $x;
A
first increment the value of #x and then test whether it has the value 10; if it does, output its value.
6
Q
if ($y– == 0) echo $y;
A
test if the value is equal to 0; if it is output the value, if its not decrement the value of $y by 1