Command-line argument parsing: Difference between revisions

Content deleted Content added
Tisane (talk | contribs)
PHP: a more useful example
Tisane (talk | contribs)
PHP: one true brace style
Line 32:
foreach( $args as $arg ) {
$tmp = explode( ':', $arg, 2 );
if( $arg[0] == "-" ) {
$args[ substr( $tmp[0], 1 ) ] = $tmp[1];
}
}
return $args;