What are common issues when reading a text file with PHP and how can the problem of ignoring leading spaces be addressed?

When reading a text file with PHP, a common issue is that leading spaces at the beginning of each line may be ignored, especially when using functions like `fgets()` or `file()`. To address this problem, you can use the `FILE_IGNORE_NEW_LINES` flag with `file()` function to preserve leading spaces.

$fileLines = file('example.txt', FILE_IGNORE_NEW_LINES);
foreach ($fileLines as $line) {
    echo $line . PHP_EOL;
}