Complete the code to assign the value 10 to the variable $x.
<?php $x [1] 10; echo $x;
The single equal sign = is used to assign a value to a variable in PHP.
Complete the code to add 5 to the variable $count using a compound assignment operator.
<?php $count = 10; $count [1] 5; echo $count;
The += operator adds the right value to the variable and assigns the result back to it.
Fix the error in the code to multiply $num by 3 using a compound assignment operator.
<?php $num = 4; $num [1] 3; echo $num;
The *= operator multiplies the variable by the right value and assigns the result back.
Complete the code to subtract 2 from $value and then assign the result back to $value.
<?php $value = 15; $value [1] 2; echo $value;
The -= operator subtracts and assigns. The semicolon ; ends the statement.
Fill both blanks to divide $total by 4, assign the result back, and then add 1.
<?php $total = 20; $total [1] 4; $total [2] 1; echo $total;
First, /= divides and assigns. Then the statement ends with ;. Next, += adds and assigns 1.