Some times we get a problem to access some external server on our server . The first check should be port status on the server that the port you are requesting to connect is open or not on your server . Today i am going to introduce a function by which you can check about the port status . So here is the function hope it will help you

function check_port($service,$port) {
    $conn = @fsockopen($service, $port, $errno, $errstr, 2);
    if ($conn) {
        fclose($conn);
        return true;
    }else
    {
    	return "disable";
    }
}

so we can call the function check_port() to check the connection . We need to argument , 1) the host name 2) port no to check . and call like this .

check_port("imap.gmail.com",143); //IMAP-simple on 143
check_port("imap.gmail.com",995); //IMAP-ssl on 995
check_port("imap.gmail.com",110); //PoP3
check_port("smtp.gmail.com",125);
check_port("smtp.gmail.com",25);
http://codingbin.com/wp-content/uploads/2015/11/Untitled11.pnghttp://codingbin.com/wp-content/uploads/2015/11/Untitled11-150x150.pngdevidphpimap,portSome times we get a problem to access some external server on our server . The first check should be port status on the server that the port you are requesting to connect is open or not on your server . Today i am going to introduce a function...coding, php, wordpress, yii, cakephp, and  jquery

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request