| Recommend this page to a friend! | 
| Info | Documentation | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 105 | All time:  9,729 This week: 47 | ||||
| Version | License | PHP version | Categories | |||
| sanitizer 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, Text processing, Security | 
| Description | Author  | |
This package can remove insecure or unnecessary parts of a string.  | 
Sanitize and escape every values in your PHP Application.
This solution will make PHP developer life easy, very easy and developers would be able to create a secure application quickly and effortlessly.
Let's see inside of this.
0.0.7
composer require maniruzzaman/sanitizer
Instantiation and loading.
// at top of the class autoload
use Maniruzzaman\Sanitizer\Sanitize;
// instantiate anywhere if needed
$sanitize = new Sanitize();
Example 1: Sanitize text with script:
$string  = 'Text with script <script>alert("you are hacked...")</script>';
Sanitize::text($string);
#Output: Text with issuealert("you are hacked...")
Example 2: Sanitize text with html texts:
$string  = 'Text with script <strong>This is strong text</strong>';
Sanitize::text($string);
#Output: Text with script This is strong text
Example 3: Sanitize attribute to filter out unnecessary strings:
$string  = 'https://devsenv.com<script>welcome</script>';
$sanitize = new Sanitize();
$sanitize->attr($string);
#Output: https:://devsenv.com
We've used PHPUnit to test our codes.
Check if everything passes test cases or not. You can check our test cases to see the implementations of Sanitizer.
// For full directory
phpunit tests
// For specific file test
phpunit tests/SanitizeTest.php
0.0.70.0.60.0.50.0.40.0.30.0.20.0.1The Library is open-sourced software licensed under the <a href="https://opensource.org/licenses/MIT">MIT license</a>.
Do you wanna support me to buy a coffee? Please be one of my patreon - https://www.patreon.com/maniruzzaman
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Data | Auxiliary data | |||
| Data | Auxiliary data | |||
| Doc. | Documentation | |||
| / | .github | 
| File | Role | Description | 
|---|---|---|
|    | 
Data | Auxiliary data | 
|    | 
Data | Auxiliary data | 
| / | src | 
| File | Role | Description | ||
|---|---|---|---|---|
|    | 
Aux. | Auxiliary script | ||
|    | 
Class | Class source | ||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
  | 
  | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.