PHP - Get Command-Line Arguments

<?php /* $ php ./testing.php --url="http://example.com" -x -y123 */ $command_line_options = getopt( 'y:x::', array ( "url::" ) ); print_r ( $command_line_options ); /* Array ( [url] => http://example.com [x] => [y] => 123 ) */

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.