Php Networking(Php ) Questions and Answers

Question 1. Which one of the following function is used to return an array consisting of various DNS resource records pertinent to a specific domain?
  1.    dns_get_record()
  2.    dns_record()
  3.    dnsrr_get_record()
  4.    dnsrr_record()
Explanation:-
Answer: Option A. -> dns_get_record()

Question 2. Which one of the following function is used to retrieve the MX records for the domain specified by hostname?
  1.    getmx()
  2.    retrieve_mx()
  3.    getmxrr()
  4.    retrieve_mxrr()
Explanation:-
Answer: Option C. -> getmxrr()

Question 3. What is the full form of DNS?
  1.    Digital Network System
  2.    Domain Network System
  3.    Digital Name Systmem
  4.    Domain Name System
Explanation:-
Answer: Option D. -> Domain Name System
The Domain Name System(DNS) is what allows you to use domain names(e.g., example.com) in place of the corresponding IP address, such as 192.0.10.10.

Question 4. Which one of the following function checks for the existence of DNS records?
  1.    checkdns()
  2.    checkdnsr()
  3.    checkdnsrr()
  4.    checkdnsa()
Explanation:-
Answer: Option C. -> checkdnsrr()
DNS records are checked based on the supplied host value and optional DNS resource record type, returning TRUE if any records are located and FALSE otherwise.

Question 5. What is the default port number of HTTP’s?
  1.    70
  2.    80
  3.    90
  4.    100
Explanation:-
Answer: Option B. -> 80

Question 6. Which one of the following function returns the port number of a specified service?
  1.    getportname()
  2.    getservername()
  3.    getserverbyname()
  4.    getservbyname()
Explanation:-
Answer: Option D. -> getservbyname()
Example- getservbyname(“http”,”tcp”) will return 80.

Question 7. Which one of the following function is used to send a e-mail using PHP script?
  1.    mail_send()
  2.    send_mail()
  3.    mailrr()
  4.    mail()
Explanation:-
Answer: Option D. -> mail()
mail(string to, string subject, string message,) using this you can send any mail.

Question 8. How many configuration directives pertinent to PHP’s mail function are available?
  1.    4
  2.    5
  3.    6
  4.    7
Explanation:-
Answer: Option B. -> 5
They are- SMTP, sendmail_from, sendmail_path, smtp_port, mail.force_extra_parameters.

Question 9. Which one of the following statements can be used to establish port 80 connection with www.examveda.com?
  1.    fsockopen(“www.examveda.com”, 80);
  2.    sockopen(80,”www.examveda.com”);
  3.    fsockopen(80,”www.examveda.com”);
  4.    sockopen(“www.examveda.com”, 80);
Explanation:-
Answer: Option A. -> fsockopen(“www.examveda.com”, 80);
The fsockopen() function establishes a connection to the resource designated by target on port.

Question 10. Which of the following statements is used to add an attachment to the mail?
  1.    $mimemail->attachment(‘attachment.pdf’);
  2.    $mimemail=>attachment(‘attachment.pdf’);
  3.    $mimemail->addAttachment(‘attachment.pdf’);
  4.    $mimemail=>addAttachment(‘attachment.pdf’);
Explanation:-
Answer: Option C. -> $mimemail->addAttachment(‘attachment.pdf’);
Call the Mail_Mime object’s addAttachment() method passing in the attachment name and extension.