mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
note incorporated, example added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@137997 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
83545ca3cd
commit
05bc9dbde0
1 changed files with 22 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/network.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.getservbyname">
|
||||
<refnamediv>
|
||||
|
@ -23,6 +23,27 @@
|
|||
<parameter>protocol</parameter> is either <literal>"tcp"</literal>
|
||||
or <literal>"udp"</literal> (in lowercase).
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>getservbyname</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$services = array('http', 'ftp', 'ssh', 'telnet', 'imap',
|
||||
'smtp', 'nicname', 'gopher', 'finger', 'pop3', 'www');
|
||||
|
||||
foreach($services as $service) {
|
||||
$port = getservbyname($service, 'tcp');
|
||||
echo $service . ": " . $port . "<br>\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
For complete list of port numbers see: &url.network.port-numbers;.
|
||||
</para>
|
||||
<para>
|
||||
See also: <function>getservbyport</function>.
|
||||
</para>
|
||||
|
|
Loading…
Reference in a new issue