Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Reporting Options

There are several methods to report the full set of options given by the user on the current command-line.

  • As a string: use the toString() method. The options are returned as a space-separated string of flag=value pairs. The value of an option that does not have a parameter is the literal string "TRUE".

  • As an array: use the toArray() method. The options are returned in a simple integer-indexed array of strings, the flag strings followed by parameter strings, if any.

  • As a string containing JSON data: use the toJson() method.

  • As a string containing XML data: use the toXml() method.

In all of the above dumping methods, the flag string is the first string in the corresponding list of aliases. For example, if the option aliases were declared like verbose|v, then the first string, verbose, is used as the canonical name of the option. The name of the option flag does not include any preceding dashes.

Zend Framework