<HTML ><HEAD ><TITLE >getservbyport</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="Network functions" HREF="ref.network.html"><LINK REL="PREVIOUS" TITLE="getservbyname" HREF="function.getservbyname.html"><LINK REL="NEXT" TITLE="openlog" HREF="function.openlog.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.getservbyname.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.openlog.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.getservbyport" >getservbyport</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN19421" ></A >getservbyport -- get Internet service which corresponds to port and protocol</DIV ><DIV CLASS="refsect1" ><A NAME="AEN19424" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><P ></P ><CODE CLASS="FUNCDEF" >string getservbyport</CODE >(int port, string protocol);<P ></P ></DIV ><P > <B CLASS="function" >getservbyport()</B > returns the Internet service associated with <TT CLASS="parameter" ><I >port</I ></TT > for the specified <TT CLASS="parameter" ><I >protocol</I ></TT > as per /etc/services. <TT CLASS="parameter" ><I >protocol</I ></TT > is either <TT CLASS="literal" >tcp</TT > or <TT CLASS="literal" >udp</TT >. See also <A HREF="function.getservbyname.html" ><B CLASS="function" >getservbyname()</B ></A >.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.getservbyname.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.openlog.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >getservbyname</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.network.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >openlog</TD ></TR ></TABLE ></DIV ></BODY ></HTML >