What potential issue arises when using the system() function in PHP to execute external programs?
The potential issue that arises when using the system() function in PHP to execute external programs is the risk of security vulnerabilities, such as command injection attacks. To mitigate this risk, it is recommended to use escapeshellarg() or escapeshellcmd() functions to escape any user input that is passed to the system() function.
$command = "ls " . escapeshellarg($user_input);
system($command);