if (eregi ("1 received", $ping_results[1], $out)) { echo " text "; } { //eval template that show images/text when the server is up } else { //eval other template that show images/text when server isn't up. }