What is the potential issue with using a nested IF statement within a while loop in PHP?

Using a nested IF statement within a while loop can lead to code that is difficult to read and maintain. To solve this issue, it's recommended to refactor the nested IF statements into separate functions or use switch statements for better readability and organization of the code.

// Example of refactoring nested IF statements within a while loop

while ($condition) {
    switch ($variable) {
        case 'value1':
            // Do something
            break;
        case 'value2':
            // Do something else
            break;
        default:
            // Default case
    }
}