What is the difference between "=" and "==" in PHP and how does it affect conditional statements?

In PHP, "=" is the assignment operator used to assign a value to a variable, while "==" is the comparison operator used to compare two values for equality. When using conditional statements, it is important to use "==" to compare values, as using "=" will result in assigning a value instead of comparing it. This can lead to unexpected behavior in conditional statements.

// Incorrect usage of "=" in a conditional statement
$number = 5;

if($number = 5) {
    echo "The number is 5";
}

// Correct usage of "==" in a conditional statement
$number = 5;

if($number == 5) {
    echo "The number is 5";
}