What are the potential pitfalls of using "include" to integrate external JPG file lists in PHP?

Using "include" to integrate external JPG file lists in PHP can potentially expose your server to security risks, as it allows for the execution of PHP code within the included file. To avoid this, it is recommended to use "file_get_contents" to read the file contents and then parse the data accordingly.

$jpg_file_list = file_get_contents('external_file_list.txt');
$jpg_files = explode("\n", $jpg_file_list);

foreach ($jpg_files as $jpg_file) {
    // Process each JPG file accordingly
}