Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 761

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>getopt</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="PHP Options&Information"
HREF="ref.info.html"><LINK
REL="PREVIOUS"
TITLE="getmyuid"
HREF="function.getmyuid.html"><LINK
REL="NEXT"
TITLE="getrusage"
HREF="function.getrusage.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.getmyuid.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.getrusage.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.getopt"
></A
>getopt</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN73909"
></A
><P
>    (PHP 4 &#62;= 4.3.0)</P
>getopt&nbsp;--&nbsp;Gets options from the command line argument list</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN73912"
></A
><H2
>Description</H2
>string <B
CLASS="methodname"
>getopt</B
> ( string options)<BR
></BR
><P
>&#13;     Returns an associative array of option / argument pairs based on the
     options format specified in <TT
CLASS="parameter"
><I
>options</I
></TT
>, or <TT
CLASS="constant"
><B
>FALSE</B
></TT
>
     on an error.
     <DIV
CLASS="informalexample"
><A
NAME="AEN73923"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="programlisting"
>$options = getopt("f:hp:"); // parse the command line ($_GLOBALS['argv'])</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
>
    </P
><P
>&#13;     The <TT
CLASS="parameter"
><I
>options</I
></TT
> 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
     <TT
CLASS="literal"
>x</TT
> recognizes an option <TT
CLASS="literal"
>-x</TT
>, and an
     option string <TT
CLASS="literal"
>x:</TT
> recognizes an option and argument
     <TT
CLASS="literal"
>-x argument</TT
>.  It does not matter if an argument has
     leading white space.
    </P
><P
>&#13;     This function will return an array of option / argument pairs.  If an
     option does not have an argument, the value will be set to <TT
CLASS="constant"
><B
>FALSE</B
></TT
>.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>This function is currently not available on Windows</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.getmyuid.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.getrusage.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>getmyuid</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.info.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>getrusage</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>