Download the PHP package clemdesign/php-mask without Composer

On this page you can find all versions of the php package clemdesign/php-mask. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-mask

php-mask

PHP Mask is a PHP library to make masks for a string.
It is an adapation of ngx-mask by JsDaddy.

Installation

PHP-Mask is available on composer:

composer require clemdesign/php-mask

Usage

In your PHP application, use the static method apply of Mask:

Arguments

$maskExpression: Patterns

The patterns are used to filter $inputValue:

code meaning
0 digits (like 0 to 9 numbers)
9 digits (like 0 to 9 numbers), but optional
A letters (uppercase or lowercase) and digits
S only letters (uppercase or lowercase)

$maskExpression: Special chars

Special chars are used in mask expressions to format output:

character
/
(
)
.
:
-
space
+
,
@

$maskExpression: Thousand separator

You can format a number in thousand separator and control precision.

The mask keys are:

To manage precision, keys shall be suffixed by .{Number}.

Example:

$maskExpression: Time validation

You can format a time according limit:

Mask meaning
H Input value shall be inside 0 and 2.
h Input value shall be inside 0 and 3.
m Input value shall be inside 0 and 5.
s Input value shall be inside 0 and 5.

$maskExpression: Percent validation

You can format a value from $inputValue as a percent and manage the precision.

Use the key percent to have a extract value from $inputValue within 0 to 100.

Suffix the key with .{Number} to manage precision (percent.2).

Example:

$config: Prefix and suffix

You have possibility to set suffix and prefix in output:

Examples

Input Mask Output
Date is 20190526 9999-99-99 2019-05-26
Month is 20190526 0*.00 2019.05
04845798798 000.000.000-99 048.457.987-98
048457987 000.000.000-99 048.457.987-
0F6.g-lm AAAA 0F6g
a036s.D2F SSSS asDF

Contributing

If you think any implementation are just not the best, feel free to submit ideas and pull requests. All your comments and suggestion are welcome.

Credits:

License

Copyright (c) 2019 clemdesign.

For use under the terms of the MIT license.


All versions of php-mask with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package clemdesign/php-mask contains the following files

Loading the files please wait ....