What is the correct syntax for an IF statement in PHP to check if a variable is empty?

When checking if a variable is empty in PHP, you can use the empty() function within an IF statement. The empty() function returns true if the variable is empty (or evaluates to false), and false otherwise. To check if a variable is empty, you can simply use the empty() function within the condition of an IF statement.

// Check if a variable is empty
if (empty($variable)) {
    // Variable is empty
    echo "Variable is empty";
} else {
    // Variable is not empty
    echo "Variable is not empty";
}