PHPackages                             jdwx/args - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. jdwx/args

ActiveLibrary[CLI &amp; Console](/categories/cli)

jdwx/args
=========

A simple PHP library for parsing command line arguments.

v2.0.0(1mo ago)15682MITPHPPHP &gt;=8.3.0

Since Apr 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jdwx/args)[ Packagist](https://packagist.org/packages/jdwx/args)[ RSS](/packages/jdwx-args/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (38)Used By (2)

jdwx/args
=========

[](#jdwxargs)

PHP library for handling command-line arguments

It's designed to provide methods for safely retrieving most common argument types, including strings, integers, floating point values, boolean flags, sets of keywords, filenames, hostnames, IP addresses, and email addresses.

It's useful for handling arguments presented to a PHP script on the shell command line, e.g.:

```
YourPrompt$ ./example.php Hello, world.
```

Or it could refer to the arguments on a command entered into a PHP-based REPL, such as a custom management tool.

Installation
------------

[](#installation)

You can require it directly with Composer:

```
composer require jdwx/args
```

Or download the source from GitHub:

Requirements
------------

[](#requirements)

This library requires PHP 8.2 or later. It might work with earlier versions of PHP 8, but it has not been tested with them.

Usage
-----

[](#usage)

### General Argument Handling

[](#general-argument-handling)

```
