mirror of
https://github.com/php/doc-it.git
synced 2026-03-24 07:32:12 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@314548 c90b9560-bf6c-de11-be94-00142212c4b1
73 lines
2.4 KiB
XML
73 lines
2.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
|
|
<refentry xml:id="function.getopt" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>getopt</refname>
|
|
<refpurpose>Ottiene le opzioni dagli argomenti della linea di comando</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>getopt</methodname>
|
|
<methodparam><type>string</type><parameter>options</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>longopts</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Restituisce una matrcie associativa con l'accoppiata opzione / valore
|
|
basata sulle opzioni attese indicate in <parameter>options</parameter>, oppure &false;
|
|
in caso di errore.
|
|
</para>
|
|
<para>
|
|
Sulle piattaforme che supportano la funzione C getopt_long, le opzioni 'lunghe'
|
|
possono essere spcificate con il parametro <parameter>longopts</parameter> (dal PHP 4.3.0).
|
|
</para>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// parse the command line ($GLOBALS['argv'])
|
|
$options = getopt("f:hp:");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
Il parametro <parameter>options</parameter> può contenere i seguenti elementi:
|
|
caratteri individualie e caratteri seguiti dai due punti per indicare un'opzione
|
|
seguita da un valore. Ad esempio, la stringa di opzione
|
|
<literal>x</literal> identifica il parametro <literal>-x</literal>, e una
|
|
stringa <literal>x:</literal> identifica un parametro ed il suo valore
|
|
<literal>-x argument</literal>. Non è rilevante se il vlore è precedeuto da
|
|
spazio.
|
|
</para>
|
|
<para>
|
|
Questa funzione restituisce l'accoppiata opzione / valore. Se l'opzione
|
|
non ha valori, il valore restituito sarà &false;.
|
|
</para>
|
|
¬e.no-windows;
|
|
</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
|
|
-->
|