Advertisement
1337_Brain

Checks if a website is up or not using isup.me

May 3rd, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * This is simple description.
  5.  *  
  6.  * @author MD Nadim Zobaer <nadimzobaer@hotmail.com>
  7.  * @copyright ecf.me, 2012
  8.  * @version 1.0
  9.  * @license http://creativecommons.org/licenses/by/3.0/legalcode  
  10.  */
  11.  
  12. /**
  13.  *  Checks if a website is up or not using isup.me
  14.  * @param string $website
  15.  * @return boolean Returns if website is up or not
  16.  */
  17. function ismysiteup($website)
  18. {
  19.     if(empty($website))
  20.     {
  21.         return false;
  22.     }
  23.     else
  24.     {
  25.         $fcg = file_get_contents("http://www.isup.me/$website");
  26.         if(strpos($fcg, "It's just you"))
  27.         {
  28.             return $website." is up!";
  29.         }
  30.         else
  31.         {
  32.             return $website." is down!";
  33.         }
  34.     }
  35. }
  36.  
  37. echo ismysiteup("ecf.me");
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement