mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Adding initial documentation for the new getopt() function.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@97526 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8377396845
commit
1a0124d88b
1 changed files with 67 additions and 0 deletions
67
reference/info/functions/getopt.xml
Normal file
67
reference/info/functions/getopt.xml
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.getopt">
|
||||
<refnamediv>
|
||||
<refname>getopt</refname>
|
||||
<refpurpose>Gets options from the command line argument list</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>getopt</methodname>
|
||||
<methodparam><type>string</type><parameter>options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns an associative array of option / argument pairs based on the
|
||||
options format specified in <parameter>options</parameter>, or &false;
|
||||
on an error.
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
$options = getopt("f:hp:"); // parse the command line ($_GLOBALS['argv'])
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>options</parameter> parameter may contain the following
|
||||
elements: individual characters, and characters followed by a colon to
|
||||
indicate an option argument is to follow. For example, an option string
|
||||
<literal>x</literal> recognizes an option <literal>-x</literal>, and an
|
||||
option string <literal>x:</literal> recognizes an option and argument
|
||||
<literal>-x argument</literal>. It does not matter if an argument has
|
||||
leading white space.
|
||||
</para>
|
||||
<para>
|
||||
This function will return an array of option / argument pairs. If an
|
||||
option does not have an argument, the value will be set to &null;.
|
||||
<note>
|
||||
<para>
|
||||
This function requires that the <link linkend="ini.register-argc-argv">
|
||||
register_argc_argv</link> configuration option be enabled.
|
||||
</para>
|
||||
</note>
|
||||
</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:"../../../../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
|
||||
-->
|
Loading…
Reference in a new issue