Picking a random server with PHP(with server online checking)

Some time ago I was facing a challenge, making a PHP script that randomly picks a server from a server list, to create a load balancing effect. The script expects that the servers are replicated, so that only the server name need to be provided. Resulting resources would be like: