Download the PHP package traderinteractive/filter-strings without Composer

On this page you can find all versions of the php package traderinteractive/filter-strings. 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 filter-strings

filter-strings-php

Build Status Scrutinizer Code Quality Coverage Status

Latest Stable Version Latest Unstable Version License

Total Downloads Daily Downloads Monthly Downloads

A filtering implementation for verifying the contents of strings and some common formats of strings.

Requirements

Requires PHP 7.0 or newer and uses composer to install further PHP dependencies. See the composer specification for more details.

Installation

filter-strings-php can be installed for use in your project using composer. The recommended way of using this library in your project is to add a composer.json file to your project. The following contents would add filter-strings-php as a dependency:

Functionality

Strings::filter

This filter verifies that the argument is a string. The second parameter can be set to true to allow null values through without an error (they will stay null and not get converted to false). The last parameters specify the length bounds of the string. The default bounds are 1+, so an empty string fails by default.

The following checks that $value is a non-empty string.

Strings::concat

This filter concatenates the given $value, $prefix and $suffix and returns the resulting string.

Strings::translate

This filter will accept a string value and return its translated value found in the given $valueMap.

Strings::explode

This filter is essentially a wrapper around the built-in explode method with the value first in order to work with the Filterer. It also defaults to using , as a delimiter. For example:

Strings::compress

This filter trims and remove superfluous whitespace from a given string.

This filter can also replace vertical whitespace such as newlines with single spaces.

Strings::redact

This filter will remove specified words from a string or, optionally, replace each letter of the words with a replacement character.

The second argument specifies the words that should be replaced and can either be an array of strings or a callable that returns an array of strings.

The third argument specifies the replacement character. If empty, the words will be removed entirely. If a string with more than one character is provided, only the first character will be used.

Strings::stripTags

This filter will strip HTML, XML, and PHP tags from a string. This filter also accepts null values, which will be returned as null.

The second, optional argument specifies a replacement string for the removed HTML and XML tags. PHP tags will be stripped without a replacement.

Url::filter

This filter verifies that the argument is a URL string according to RFC2396. The second parameter can be set to true to allow null values through without an error (they will stay null and not get converted to false).

The following checks that $value is a URL.

Email::filter

This filter verifies that the argument is an email.

The following checks that $value is an email.

Json::validate

This filter verifies that the value is in a valid JSON format.

The second parameter can be set to true to allow null values through without an error.

The third parameter determines the maximum recursion depth that is allowed.

The following checks that $value is a valid JSON string.

Json::parse

This filter parses a valid JSON string into an array, int, double, or bool. Invalid JSON will throw an error.

The second parameter can be set to true to allow null values through without an error.

The third parameter determines the maximum recursion depth that is allowed.

The following checks that $value is a valid JSON string and parses it into an array.

UuidFilter::filter

This filter verifies a given string is a valid universally unique identifier.

The second parameter can be set to true to allow null values through without an error.

The third parameter can be set to true to allow Nil UUIDs values through without an error.

The fourth parameter determines which UUID version the value will be validated against. By default, the filter will succeed if the values matches version 1, 2, 3, 4, 5, 6, or 7

XmlFilter::filter

This filter ensures the given string is valid XML.

XmlFilter::extract

This filter accepts an XML string and an xpath. It will return the single element found at the xpath.

XmlFilter::validate

This filter accepts an XML string and a filepath to an XSD. It ensures the given XML is valid using the given XSD and returns the original XML.

Contact

Developers may be contacted at:

Project Build

With a checkout of the code get Composer in your PATH and run:

For more information on our build process, read through out our Contribution Guidelines.


All versions of filter-strings with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
traderinteractive/exceptions Version ^2.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 traderinteractive/filter-strings contains the following files

Loading the files please wait ....