How can arrays be effectively used in PHP to streamline the process of checking multiple servers' reachability?

When checking the reachability of multiple servers in PHP, arrays can be effectively used to store the list of server addresses. By iterating over the array and using functions like `fsockopen` to check the connection status, you can streamline the process and easily manage a large number of servers.

<?php

$servers = array(
    'server1.com',
    'server2.com',
    'server3.com'
);

foreach ($servers as $server) {
    $fp = @fsockopen($server, 80, $errno, $errstr, 1);
    if ($fp) {
        echo "$server is reachable<br>";
        fclose($fp);
    } else {
        echo "$server is not reachable<br>";
    }
}

?>