mirror of
https://github.com/php/doc-it.git
synced 2026-04-30 02:33:13 +02:00
21aa6ad9fe
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@314552 c90b9560-bf6c-de11-be94-00142212c4b1
78 lines
2.5 KiB
XML
78 lines
2.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- splitted from ./it/functions/network.xml, last change in rev 1.1 -->
|
|
<!-- last change to 'getservbyname' in en/ tree in rev 1.2 -->
|
|
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
|
|
<!-- CREDITS: cortesi -->
|
|
<!-- OLD-Revision: 1.60/EN.1.2 -->
|
|
<refentry xml:id="function.getservbyname" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>getservbyname</refname>
|
|
<refpurpose>
|
|
Ottiene il numero di porta associato ad un servizio Internet e ad un protocollo
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>getservbyname</methodname>
|
|
<methodparam><type>string</type><parameter>servizio</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>protocollo</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>getservbyname</function> restituisce la porta Internet
|
|
corrispondente a <parameter>servizio</parameter> per il
|
|
<parameter>protocollo</parameter> specificato come in
|
|
<filename>/etc/services</filename>.
|
|
<parameter>protocollo</parameter> può essere sia <literal>"tcp"</literal>
|
|
che <literal>"udp"</literal> (scritti in minuscolo). Restituisce &false; se
|
|
<parameter>service</parameter> o <parameter>protocol</parameter> non sono
|
|
trovati.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Esempio di uso di <function>getservbyname</function></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>
|
|
Per avere la lista completa dei numeri di porta vedere: &url.network.port-numbers;.
|
|
</para>
|
|
<para>
|
|
Vedere anche: <function>getservbyport</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|