File: README.md

Recommend this page to a friend!
  Classes of Faris AL-Otaibi  >  PHP Sanitization Functions  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Sanitization Functions
Verify and clean values to assure they are valid
Author: By
Last change: Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Date: 2 months ago
Size: 3,626 bytes
 

 

Contents

Class file image Download

<p align="center">

<img align="center" src="https://d.top4top.io/p_1862a8k1e1.png" height="350px" />

</p>

PhpSanitization

1 2 3 4 5 6 7 8

About

Simple PHP Sanitization Class

This is a simple class that can verify and clean values to assure they are valid.

It can take a given string and remove or encode certain types of text values, so it can be displayed in Web pages lowering the risk of being used to perform security attacks.

The class can also sanitize arrays of data by processing the array values one by one.

Features

  1. Out-Of-The-Box
  2. Support String, Arrays, and Associative Arrays
  3. Escape PDO and SQL queries
  4. Easy to Use

Requirements

  1. PHP 7.0+
  2. Composer

How to install

$ composer require phpsanitization/phpsanitization

Usage

Class Inclusion

include_once 'vendor/autoload.php';

use PhpSanitization\PhpSanitization\Sanitization;

$sanitizer = new Sanitization();

useSanitize

echo $sanitizer->useSanitize("<script>alert('xss');</script>");

useEscape

echo $sanitizer->useEscape("SELECT * FROM `users` WHERE `username` = 'admin';");

useTrim

echo $sanitizer->useTrim(" This is a text ");

useHtmlEntities

echo $sanitizer->useHtmlEntities("<script>alert('This is js code');</script>");

useFilterVar

echo $sanitizer->useFilterVar("This is a string");

useStripTags

echo $sanitizer->useStripTags("<script>alert('This is js code');</script>");

useStripSlashes

echo $sanitizer->useStripSlashes("C:\Users\Faris\Music");

useHtmlSpecialChars

echo $sanitizer->useHtmlSpecialChars("<script>alert('This is js code');</script>");

setData

$sanitizer->setData("This is data");

getData

echo $sanitizer->getData();

Screenshot

Screenshot

Documentation

The documentation for PhpSanitization is available here

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.

FOSSA Status

Copyright

Open Source Love

Copyright (c) FarisCode - 2021


For more information send a message to info at phpclasses dot org.