variables Flashcards

1
Q

add a value to a variable

A

$x += 10;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

subtract a value from a variable

A

$x -= 10;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

increment the value of a variable by 1

A

++$x;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

decrement the value of a variable by 1

A

–$y;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly