Skip to content

erlandmuchasaj/sanitize

Repository files navigation

PHP sanitize

This is a PHP package that helps to sanitize your input when performing search queries to DB. It cleans the input from all malicious characters.

Installation

You can install the package via composer:

composer require erlandmuchasaj/sanitize

Usage

Sanitize library offers a sanitize method that takes a parameter a dirty string parameter and return a cleaned string.

use ErlandMuchasaj\Sanitize\Sanitize;

$dirtyString = 'Hello - World';

$sanitizedString = Sanitize::sanitize($dirtyString);

// do something with the sanitized text
// you can: $words = explode(' ', $sanitizedString);
// and search the DB per each word.

Support me

I invest a lot of time and resources into creating best in class open source packages.

If you found this package helpful you can show support by clicking on the following button below and donating some amount to help me work on these projects frequently.

buy me a coffee

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please see SECURITY for details.

Credits

License

The MIT License (MIT). Please see License File for more information.