Is there a native \"PHP way\" to parse command arguments from a string? For example, given the following string:
foo \"bar \\\"baz
I would recommend going another way. There is already a "standard" way of doing command line arguments. it's called get_opts:
http://php.net/manual/en/function.getopt.php
I would suggest that you change your script to use get_opts, then anyone using your script will be passing parameters in a way that is familiar to them and kind of "industry standard" instead of having to learn your way of doing things.