What are the potential pitfalls of using if-else statements within a PHP case statement?

Using if-else statements within a PHP case statement can lead to code redundancy and decreased readability. To avoid this, you can use a switch statement with multiple case conditions instead of nested if-else statements.

switch ($variable) {
    case 'condition1':
        // code for condition1
        break;
    case 'condition2':
        // code for condition2
        break;
    default:
        // default code
}