1.

Which one of the following function returns the port number of a specified service?(a) getportname()(b) getservername()(c) getserverbyname()(d) getservbyname()I have been asked this question in an interview for job.This interesting question is from Networking with PHP topic in chapter File and Session Handling in PHP of PHP

Answer»

The correct answer is (d) getservbyname()

To EXPLAIN: The function fgetservbyname() returns the PORT NUMBER for a given Internet service and PROTOCOL. Example-getservbyname(“http”,”TCP”) will return 80.



Discussion

No Comment Found

Related InterviewSolutions