Download the PHP package fernandozueet/php-sanitize without Composer
On this page you can find all versions of the php package fernandozueet/php-sanitize. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fernandozueet/php-sanitize
More information about fernandozueet/php-sanitize
Files in fernandozueet/php-sanitize
Informations about the package php-sanitize
FZ PHP SANITIZE
Sanitize php values.
Documentation
- Requirements
- Installation
- Mode of use Array
- Mode of use Individual
- Mode of use Laravel
- Custom filter
- Filter striptags
- Filter cnpj
- Filter cpf
- Filter numeric
- Filter alphanumeric
- Filter alpha
- Filter url
- Filter email
- Filter strtolower
- Filter strtoupper
- Filter ucwords
- Filter ucfirst
- Filter lcfirst
- Filter rtrim
- Filter ltrim
- Filter trim
- Filter date
- Filter type
- Filter numberFormat
- Filter pregReplace
- Filter filterVar
- Contributing
- Security
- Credits
- License
Requirements
- PHP 7.3 or superior
- Composer
Installation
Install this package with composer:
Mode of use Array
Output:
Mode of use Individual
Output:
Mode of use Laravel
Laravel 5.8 or superior
Custom filter
1- Create class filter
2- Create a function in another pho file to call the filter
3- Use filter
Output:
Filters
striptags
Strip HTML and PHP tags from a string.
striptags(string $allowable_tags = "")
Output:
cnpj
Format the cnpj format number.
cnpj()
Output:
cpf
Format the cpf format number.
cpf()
Output:
numeric
Numbers.
numeric()
Output:
alphanumeric
Letters from a to z and numbers.
alphanumeric(bool $spaces = false)
Output:
alpha
Letters from a to z.
alpha(bool $spaces = false)
Output:
url
filter_var FILTER_SANITIZE_URL
url()
Output:
filter_var FILTER_SANITIZE_EMAIL
email()
Output:
strtolower
Make a string lowercase.
strtolower()
Output:
strtoupper
Make a string uppercase.
strtoupper()
Output:
ucwords
Uppercase the first character of each word in a string.
ucwords(string $delimiters = " \t\r\n\f\v")
Output:
ucfirst
Make a string's first character uppercase.
ucfirst()
Output:
lcfirst
Make a string's first character lowercase.
lcfirst()
Output:
rtrim
Removes blanks (or other characters) from the beginning of the string.
rtrim(string $charlist = " \t\n\r\0\x0B")
Output:
ltrim
Removes blanks (or other characters) from the beginning of the string.
ltrim(string $charlist = " \t\n\r\0\x0B")
Output:
trim
Removing space at the beginning and end of a string.
trim(string $charlist = " \t\n\r\0\x0B")
Output:
date
Date format.
date(string $format = 'Y-m-d')
Output:
type
Format a types.
type(string $type)
$type: string bool int float array object
Output:
numberFormat
Format a number with grouped thousands.
numberFormat(int $decimals = 0, string $decimalpoint = '.', string $separator = ',')
Output:
pregReplace
Perform a regular expression search and replace.
pregReplace($pattern, $replacement)
http://php.net/manual/en/function.preg-replace.php
Output:
filterVar
Filters a variable with a specified filter.
filterVar(int $filter = FILTER_DEFAULT, $options = null)
http://php.net/manual/en/function.filter-var.php
Contributing
Please see CONTRIBUTING for details.
Security
If you discover security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The FZ Php Sanitize is licensed under the MIT license. See License File for more information.