MrPaan

jalil

Nov 16th, 2013
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. <?php
  2.  
  3. checkport("www.google.com", 80);
  4.  
  5. function checkport($host, $port) {
  6.   $fp = @fsockopen($host, $port, $errno, $errstr, 10);
  7.   if ( !$fp ) {
  8.     fclose($fp);
  9.     echo "Port close";
  10.   } else {
  11.     fclose($fp);
  12.     echo "Port open";
  13.   }
  14. }
  15.  
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment