What is the potential issue with using nested for loops in PHP, as seen in the provided code snippet?

Using nested for loops in PHP can lead to performance issues, especially if the loops iterate over a large dataset. Each iteration of the inner loop is executed for every iteration of the outer loop, resulting in a high number of total iterations. To solve this issue, consider refactoring the code to reduce the number of nested loops or find alternative approaches to achieve the desired outcome.

// Example of refactored code without nested loops
$array1 = [1, 2, 3];
$array2 = ['a', 'b', 'c'];

foreach ($array1 as $num) {
    foreach ($array2 as $letter) {
        echo $num . $letter . " ";
    }
}