How can PHP be utilized for system administration tasks, such as checking for package updates and installations?

PHP can be utilized for system administration tasks by using functions like `exec()` or `shell_exec()` to run shell commands. For example, to check for package updates and installations, you can use PHP to execute commands like `apt-get update` or `apt-get upgrade` on a Linux system. This allows you to automate these tasks and retrieve the output for further processing.

// Check for package updates
$updateOutput = shell_exec('apt-get update');
echo $updateOutput;

// Install package updates
$upgradeOutput = shell_exec('apt-get upgrade -y');
echo $upgradeOutput;