you can ping using php
still, its going to slow your script down, and pinging a few other servers everytime a user requests your page is not efficient at all.
i would create a database to hold the values of the servers, and whether they are offline or not.
then create a small php script which will ping those servers, and update the status in the db. run that script via cron every 10min or whatever interval you want.
then from your script which displays the links, you can just do a quick db call to see if they are online or not.