Multiple choice technology programming languages

The following will result in which of the following, if the prize is currently "10 dollars" print 'You won $prize';

  1. You won $10.00
  2. You won 10 dollars

  3. You won $prize
  4. You won $10
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

PHP single-quoted strings are literal. The variable \$prize inside single quotes is treated as text, not as a variable to be interpolated. Therefore print 'You won \$prize' outputs exactly that string without substituting the value of $prize (which is '10 dollars'). Double quotes would be needed for interpolation.