PHPackages                             carono/php-adblock-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. carono/php-adblock-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

carono/php-adblock-parser
=========================

PHP parser for Adblock Plus filters

v0.1.7(6y ago)150MITPHP

Since Oct 10Pushed 6y agoCompare

[ Source](https://github.com/carono/php-adblock-parser)[ Packagist](https://packagist.org/packages/carono/php-adblock-parser)[ Docs](https://github.com/limonte/php-adblock-parser)[ RSS](/packages/carono-php-adblock-parser/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

PHP parser for Adblock Plus filters
===================================

[](#php-parser-for-adblock-plus-filters)

[![Build Status](https://camo.githubusercontent.com/e88a25472141a1ad0ed84ba465bf3c7d4033973bdd1da8ea7563677348883304/68747470733a2f2f7472617669732d63692e6f72672f6c696d6f6e74652f7068702d6164626c6f636b2d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/limonte/php-adblock-parser)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e3a019fc4959dc102f9c6216af86d13c96d3de6c74447a73b86d569db71cb5aa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696d6f6e74652f7068702d6164626c6f636b2d7061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/limonte/php-adblock-parser/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/d068387d65b27f4ded6948da65be30058d583a47696a6fffa8cc6bdb9cdf4934/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696d6f6e74652f7068702d6164626c6f636b2d7061727365722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/limonte/php-adblock-parser/?branch=master)

Usage
-----

[](#usage)

To learn about Adblock Plus filter syntax check these links:

-
-

1. Get filter rules somewhere: write them manually, read lines from a file downloaded from [EasyList](https://easylist.to/), etc.:

    ```
    $rules = [
        "||ads.example.com^",
        "@@||ads.example.com/notbanner^$~script",
    ];
    ```
2. Create AdblockRules instance from the rules array:

    ```
    use Limonte\AdblockParser;

    $adblockParser = new AdblockParser($rules);
    $adblockParser->addRules($anotherRules);
    ```
3. Use this instance to check if an URL should be blocked or not:

    ```
    $adblockParser->shouldBlock("http://ads.example.com"); // true
    $adblockParser->shouldBlock("http://non-ads.example.com"); // false
    ```

Related projects
----------------

[](#related-projects)

- Google Safebrowsing PHP library: [limonte/google-safebrowsing](https://github.com/limonte/google-safebrowsing)
- McAfee SiteAdvisor PHP library: [limonte/mcafee-siteadvisor](https://github.com/limonte/mcafee-siteadvisor)
- Check if link is SPAM: [limonte/spam-link-analyser](https://github.com/limonte/spam-link-analyser)

---

- Python parser for Adblock Plus filters: [scrapinghub/adblockparser](https://github.com/scrapinghub/adblockparser/)
- EasyList filter subscription: [easylist/easylist](https://github.com/easylist/easylist/)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~158 days

Recently: every ~276 days

Total

8

Last Release

2398d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6193985?v=4)[Александр Касьянов](/maintainers/carono)[@carono](https://github.com/carono)

---

Top Contributors

[![carono](https://avatars.githubusercontent.com/u/6193985?v=4)](https://github.com/carono "carono (3 commits)")[![j-nolan](https://avatars.githubusercontent.com/u/11057256?v=4)](https://github.com/j-nolan "j-nolan (1 commits)")[![misantron](https://avatars.githubusercontent.com/u/9839955?v=4)](https://github.com/misantron "misantron (1 commits)")

---

Tags

parseradblock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/carono-php-adblock-parser/health.svg)

```
[![Health](https://phpackages.com/badges/carono-php-adblock-parser/health.svg)](https://phpackages.com/packages/carono-php-adblock-parser)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

2.9k404.0M702](/packages/league-commonmark)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
