Join Up!
96806 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousgetmyuidgetrusagenext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German

getopt

(no version information, might be only in CVS)

getopt -- Gets options from the command line argument list

Description

string getopt ( string options)

Returns an associative array of option / argument pairs based on the options format specified in options, or FALSE on an error.

$options = getopt("f:hp:"); // parse the command line ($_GLOBALS['argv'])

The options 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 x recognizes an option -x, and an option string x: recognizes an option and argument -x argument. It does not matter if an argument has leading white space.

This function will return an array of option / argument pairs. If an option does not have an argument, the value will be set to FALSE.

Nota: This function requires that the register_argc_argv configuration option be enabled.

User Contributed Notes
getopt
add a note about notes
There are no user contributed notes for this page.
previousgetmyuidgetrusagenext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST