Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- checkport("www.google.com", 80);
- function checkport($host, $port) {
- $fp = @fsockopen($host, $port, $errno, $errstr, 10);
- if ( !$fp ) {
- fclose($fp);
- echo "Port close";
- } else {
- fclose($fp);
- echo "Port open";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment