syntatis / utils
Handy functions for PHP
Installs: 3 288
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
Requires
- php: >=7.4
- egulias/email-validator: >=3.2.6
- jawira/case-converter: ^3.5
- symfony/validator: >=5.4
Requires (Dev)
- composer/installers: ^2.2
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- phpcompatibility/php-compatibility: ^9.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.8
- symfony/var-dumper: >=5.4
- syntatis/coding-standard: ^1.0
This package is auto-updated.
Last update: 2024-05-05 18:48:29 UTC
README
📦 utils-phpHandy functions for PHP
Installation
composer require syntatis/utils
Usage
This PHP package includes a number of functions to perform common value validation, such as if a value is an email, URL, or not being blank.
Function | Description |
---|---|
is_blank |
Validates whether a value is blank or empty. |
is_email |
Validates whether a value is a valid email address. |
is_url |
Validates whether a value is a valid URL. |
is_uuid |
Validates whether a value is a valid UUID. |
is_semver |
Validates whether a value is a valid SemVer format. |
is_ip_address |
Validates whether a value is a valid IPv4 or IPv6 address. |
is_unique |
Validates that all elements in the provided collection are unique. |
For examples:
use function Syntatis\Utils\is_blank; use function Syntatis\Utils\is_email; // Whether a value is blank or empty. is_blank(''); // `true`. is_blank(' '); // `true`. is_blank('foo '); // `false`.
For other functions and examples, please refer to the Wiki.