PHP Classes

Read arguments: Read and validate shell command line arguments

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 303 All time: 7,379 This week: 173Up
Version License PHP version Categories
read-cli-arguments 1.0.0BSD License3.0Console, Validation


This class can can be used to read and validate shell command line arguments.

It can parse the values of arguments passed to a PHP script started from a command line shell to validate them according to rules defined by the current script.

It supports mandatory arguments, optional arguments, switch arguments, multiple alternatives to an option switches, and a special argument that makes show a nicely formatted help usage message.

The class extract the argument values into an array if the argument rules are validated.

Picture of Manuel Lemos
  Performance   Level  
Name: Manuel Lemos is available for providing paid consulting. Contact Manuel Lemos .
Classes: 45 packages by
Country: Portugal Portugal
Age: 55
All time rank: 1
Week rank: 7 Down1 in Portugal Portugal Equal

  • read-cli-arguments.png
  Files folder image Files  
File Role Description
Plain text file read_arguments.php Class Read arguments class
Accessible without login HTML file read_arguments_class.html Doc. Class documentation
Accessible without login Plain text file test_read_arguments.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,379
This week:173Up
User Comments (1)
Its a very good class ! lool BUt a little confuse, you embed ...
13 years ago (Josť Filipe Lopes Santos)