1. Question:How do you retrive internet service port number in php? 

    Answer
    The getservbyname() function returns the port number of a specified service.

    Prototype:

    int getservbyname(string service, string protocol)

    Example:

    <?php
       echo "HTTP's default port number is: ".getservbyname("http","tcp");

    ?>






    1. Report
  2. Question:How do you get a socket connection in php? 

    Answer
    The fsocketopen() function establishes a connection to the resource designated by target on port.

    Prototype:

    resource fsockopen( string target, int port [, int erron [, string errsting [, float timeout]]])

    Example:

    <?php
       $http=fsockopen("www.example.com",80);
     
       $req="GET / HTTP/1.1\r\n";
       $req.="Host: www.example.com\r\n";
       $req.="Connection: Close\r\n\r\n";

      fputs($http,$req);
     
      while(!feof($http)){

          echo fgets($http,1024);

       }
    fclose($http);
     
    ?>






    1. Report
  3. Question:What do you mean by directory service? 

    Answer
    Directory Service: It offers system administrators, developers, and end users alike a consistent, efficient, and secure means for viewing and managing resources such as people, fles, printers, and applications.






    1. Report
  4. Question:How do you connect to an LDAP server? 

    Answer
    The ldap_connect() function establishes a connection to an LDAP server identified by a specific host name and optionally a port number.

    Prototype:

    resource ldap_connect([stiring hostname[, int port]])

    Example:

    <?php
       $host="ldap.wjgilmore.com";
       $post="389";
       $connection=ldap_connect($host,$port) ro die("Can't establish LDAP connection");
    ?>






    1. Report
  5. Question:What do you mean by web service? 

    Answer
    Web service: Web services are typically application programming interfaces (APIs) or web APIs that are accessed via Hypertext Transfer Protocol (HTTP) and executed on a remote system hosting the requested services.






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd