<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.network.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.getservbyport.php',
    1 => 'getservbyport',
    2 => 'Get Internet service which corresponds to port and protocol',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'Network Functions',
  ),
  'prev' => 
  array (
    0 => 'function.getservbyname.php',
    1 => 'getservbyname',
  ),
  'next' => 
  array (
    0 => 'function.header.php',
    1 => 'header',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/network/functions/getservbyport.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.getservbyport" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">getservbyport</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">getservbyport</span> &mdash; <span class="dc-title">Get Internet service which corresponds to port and protocol</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.getservbyport-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>getservbyport</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$port</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$protocol</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>getservbyport()</strong></span> returns the Internet service
   associated with <code class="parameter">port</code> for the specified
   <code class="parameter">protocol</code> as per <var class="filename">/etc/services</var>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.getservbyport-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">port</code></dt>
     <dd>
      <p class="para">
       The port number.
      </p>
     </dd>
    
    
     <dt><code class="parameter">protocol</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">protocol</code> is either <code class="literal">&quot;tcp&quot;</code>
       or <code class="literal">&quot;udp&quot;</code> (in lowercase).
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.getservbyport-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the Internet service name as a string,  or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.getservbyport-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.getservbyname.php" class="function" rel="rdfs-seeAlso">getservbyname()</a> - Get port number associated with an Internet service and protocol</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>