What is the issue with using leading zeros in a PHP for loop?

Using leading zeros in a PHP for loop can cause unexpected results because PHP treats numbers with leading zeros as octal (base-8) numbers. To solve this issue, you can use the `sprintf` function to format the numbers with leading zeros as needed.

for ($i = 1; $i <= 10; $i++) {
    $formattedNumber = sprintf("%02d", $i);
    echo $formattedNumber . "\n";
}