PHPackages                             zmog/pquery - 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. zmog/pquery

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

zmog/pquery
===========

A jQuery like html dom parser written in php. This fork add fixes for php 8

1.0.0(2y ago)0446↓100%LGPL-2.1PHPPHP &gt;=8.0.0

Since Jan 23Pushed 2y agoCompare

[ Source](https://github.com/Gizmo091/pquery)[ Packagist](https://packagist.org/packages/zmog/pquery)[ RSS](/packages/zmog-pquery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

pQuery
======

[](#pquery)

[![Build Status](https://camo.githubusercontent.com/6c6829f442cd235dd0e8d82b42db10dae774933eacc5e757bcf304c359cb4791/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://travis-ci.org/tburry/pquery)[![Coverage](https://camo.githubusercontent.com/57c5205b74026f3cbdc48fce5c9937fee2d7762ffc35ad9495f98c75c65fddee/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/tburry/pquery/)[![Latest Stable Version](https://camo.githubusercontent.com/5dc1a0ddb8c48dbc1cc20c98c18f9f5fdd34e2bac42654b064e38d7de586a3ac/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://packagist.org/packages/tburry/pquery)

pQuery is a jQuery like html dom parser written in php. It is a fork of the [ganon dom parser](https://code.google.com/p/ganon/).

Basic usage
-----------

[](#basic-usage)

To get started using pQuery do the following.

1. Require the pQuery library into your project using [composer](http://getcomposer.org/doc/01-basic-usage.md#the-require-key).
2. Parse a snippet of html using `pQuery::parseStr()` or `pQuery::parseFile()` to return a document object model (DOM).
3. Run jQuery like functions on the DOM.

Example
-------

[](#example)

The following example parses an html string and does some manipulation on it.

```
$html = '
  Hello
  Cruel
  World
';

$dom = pQuery::parseStr($html);

$dom->query('.inner')
    ->tagName('span');

$dom->query('.adj')
    ->html('Beautiful')
    ->tagName('i');

echo $dom->html();
```

Differences between pQuery and ganon
------------------------------------

[](#differences-between-pquery-and-ganon)

pQuery is a fork of the [ganon php processor](https://code.google.com/p/ganon/). Most of the functionality is identical to ganon with the following exceptions.

- pQuery is a composer package.
- pQuery renames ganon's classes and puts them into a namespace.
- pQuery is used only with objects rather than functions so that it can be autoloaded.
- pQuery Adds the `IQuery` interface and the `pQuery` object that define the jQuery-like interface for querying the dom.
- pQuery implements more of jQuery's methods. See the `IQuery` interface for a list of methods.
- pQuery supports adding tags to the dom using the `` notation rather than just `div`.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.8% 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

Unknown

Total

1

Last Release

846d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6045f24a5a5342628edcac98302f5ab2a6e4acfba94e79876730da54424e177d?d=identicon)[Mathieu Vedie](/maintainers/Mathieu%20Vedie)

---

Top Contributors

[![tburry](https://avatars.githubusercontent.com/u/97432?v=4)](https://github.com/tburry "tburry (60 commits)")[![Gizmo091](https://avatars.githubusercontent.com/u/289745?v=4)](https://github.com/Gizmo091 "Gizmo091 (2 commits)")

---

Tags

phpdomganon

### Embed Badge

![Health badge](/badges/zmog-pquery/health.svg)

```
[![Health](https://phpackages.com/badges/zmog-pquery/health.svg)](https://phpackages.com/packages/zmog-pquery)
```

###  Alternatives

[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[tburry/pquery

A jQuery like html dom parser written in php.

138499.9k6](/packages/tburry-pquery)[ressio/pharse

Fastest PHP HTML Parser

8478.4k](/packages/ressio-pharse)[bupy7/xml-constructor

The array-like constructor of XML document structure.

1337.9k](/packages/bupy7-xml-constructor)

PHPackages © 2026

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