cece Sat Aug 16 12:25:33 2003 EDT
Modified files:
/phpdoc/en/reference/network/functions getprotobyname.xml
Log:
example note - incorporated
Index: phpdoc/en/reference/network/functions/getprotobyname.xml
diff -u phpdoc/en/reference/network/functions/getprotobyname.xml:1.2
phpdoc/en/reference/network/functions/getprotobyname.xml:1.3
--- phpdoc/en/reference/network/functions/getprotobyname.xml:1.2 Wed Apr 17
02:42:04 2002
+++ phpdoc/en/reference/network/functions/getprotobyname.xml Sat Aug 16 12:25:32
2003
@@ -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.getprotobyname">
<refnamediv>
@@ -18,6 +18,25 @@
<function>getprotobyname</function> returns the protocol number
associated with the protocol <parameter>name</parameter> as per
<filename>/etc/protocols</filename>.
+ </para>
+ <para>
+ <example>
+ <title><function>getprotobyname</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$protocol = 'tcp';
+$get_prot = getprotobyname($protocol);
+if ( $get_prot == -1 ) {
+ // if nothing found, returns -1
+ print 'Invalid Protocol';
+} else {
+ print 'Protocol #'.$get_prot;
+}
+?>
+]]>
+ </programlisting>
+ </example>
</para>
<para>
See also: <function>getprotobynumber</function>.
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php