What common mistake is the user making in the PHP code provided for temperature calculations?
The common mistake in the provided PHP code is using the assignment operator `=` instead of the comparison operator `==` when checking the value of the `$unit` variable. This results in the assignment of the value 'F' to the variable `$unit`, causing the subsequent temperature calculations to be incorrect. To fix this issue, the comparison operator `==` should be used instead.
<?php
$temperature = 32;
$unit = 'C';
if ($unit == 'C') {
$fahrenheit = ($temperature * 9/5) + 32;
echo "Temperature in Fahrenheit: " . $fahrenheit;
} elseif ($unit == 'F') {
$celsius = ($temperature - 32) * 5/9;
echo "Temperature in Celsius: " . $celsius;
} else {
echo "Invalid unit provided.";
}
?>