Skip to content

Instantly share code, notes, and snippets.

@tlongren
Created June 19, 2013 18:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlongren/5816566 to your computer and use it in GitHub Desktop.
Save tlongren/5816566 to your computer and use it in GitHub Desktop.
Check if API url is online before proceeding with calls to said API
<?php
$checkapi = (@fsockopen("solus.fliphost.net", 443, $errno, $errstr, 0.4) ? "up" : "down");
echo $checkapi;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment