What is the correct syntax for checking and changing the value of a variable in PHP?

In PHP, you can check and change the value of a variable using conditional statements like if and else. To check the value of a variable, you can use comparison operators like == or ===. To change the value of a variable, you can simply assign a new value to it using the assignment operator (=).

// Example of checking and changing the value of a variable
$number = 10;

if ($number == 10) {
    $number = 20;
}

echo $number; // Output: 20