What potential issues can arise when using the system() function in PHP scripts, particularly in relation to header modifications?

When using the system() function in PHP scripts, potential issues can arise if the command being executed modifies headers, as this can interfere with the script's output. To solve this issue, you can use output buffering to capture the command's output and prevent it from interfering with the headers.

<?php
ob_start();
system('command_to_execute');
ob_end_clean();
?>