PHPackages                             ibraheem-ghazi/html-stripper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ibraheem-ghazi/html-stripper

AbandonedArchivedPackage[Utility &amp; Helpers](/categories/utility)

ibraheem-ghazi/html-stripper
============================

php parser for html tags and html inline styles , to allow or prevent some css styles with any value or specific value

1.0(8y ago)122MITPHPPHP &gt;=5.6.0

Since Apr 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ibraheem-ghazi/HTMLStripper)[ Packagist](https://packagist.org/packages/ibraheem-ghazi/html-stripper)[ RSS](/packages/ibraheem-ghazi-html-stripper/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

html-stripper
=============

[](#html-stripper)

php parser for html tags and html inline styles , to allow or prevent some css styles with any value or specific value

Install
=======

[](#install)

```
 $ composer require ibraheem-ghazi/html-stripper

```

Functions
=========

[](#functions)

**strip($str, $useStripTags=true, $allowedTags= \['p','span','b','strong','u','ins','i','em','s','del','ul','li','ol','table','thead','tfoot','tbody','tr','th','td','br'\])**

```
paramters:
$str           // **(string)** the html code for topic or post
$useStripTags  // **(bool)**   should use strip tags alongside css stripper
$allowedTags   // **(array)**  if strip tags is used , then which tags are allowed

return clean clone of input string

```

**addStyle($attribute,$value='\*',$condition='=')**

```
paramters:
$attribute           // **(string)** which css attribute should allow (Ex: width, height, text-align, font-size, direction, ...etc)
$value      		 // **(string)**   which value should allow for this css attribute ('*' mean any value is allowed for this attribute)
$condition   		 // **(string)**  allowed value should be equal, less than, or greather than specified value

**use these constants for `` $condition `` : **
HTMLStripper::EQUAL
HTMLStripper::LESS_THAN
HTMLStripper::GREATER_THAN

```

**Example:**

```
