for those massive echo statements you might try heredoc syntax ([man]types.string[/man] at php.net). also, if you're running this through the CLI (as you should be) just use $argc and $argv, they're automatically registered as global by default in the CLI.