PHPackages                             cagartner/phpquery - 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. cagartner/phpquery

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

cagartner/phpquery
==================

PHP5.3+ namespaced version of phpQuery with enhanced CSS support

0.9.13(4y ago)5578.0k↑27.7%1211MITPHPPHP &gt;=5.3.3

Since Mar 21Pushed 4y ago2 watchersCompare

[ Source](https://github.com/cagartner/phpquery)[ Packagist](https://packagist.org/packages/cagartner/phpquery)[ Docs](http://code.google.com/p/phpquery/)[ RSS](/packages/cagartner-phpquery/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (11)

Revisiting PhpQuery
===================

[](#revisiting-phpquery)

[![Build Status](https://camo.githubusercontent.com/889fde21afa017cef8375e43bf0732fd5efaa8077953d384cbedbcc259cc0d12/68747470733a2f2f7472617669732d63692e6f72672f776974746977732f70686f6e6172632e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/wittiws/phonarc)

Basic usage of this fork
------------------------

[](#basic-usage-of-this-fork)

```
// This gives you the phpQuery object as normally used.
use PhpQuery\PhpQuery as phpQuery;

// This creates the pq() function in your namespace.
PhpQuery::use_function(__NAMESPACE__);

// This creates the pq() function in the global namespace.
PhpQuery::use_function();
```

About this fork
---------------

[](#about-this-fork)

This fork includes several modernizations:

1. Merged  with
2. Removed CSSParser from this repository and included it via composer
3. Added PhpQuery\\ namespace
4. Adjusted the folder structure to reflect usage of PSR-4
5. Corrected the unit tests and integrated with travis-ci

Beyond these adjustments, this project will be minimally maintained. For more phpQuery usage information and fork history, I highly recommend you review the  README.

Very Similar Project
--------------------

[](#very-similar-project)

See [QueryPath](https://github.com/technosophos/querypath) for a more active project that also works to replicate the jQuery syntax for PHP.

My Preferred Alternative
------------------------

[](#my-preferred-alternative)

There are several alternatives to phpQuery out there. While several have a healthy adoption rate, I was looking for a library that leveraged SimpleXML and focused on the PHP use case rather than building all of the functionality from scratch and adding unnecessarily methods and selectors simply for jQuery semantic completeness. In the end, I selected to launch a project that attempts to a be a PHP-centric lightweight wrapper for SimpleXML. [Learn more about QuipXml.](https://github.com/wittiws/quipxml)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~675 days

Recently: every ~723 days

Total

6

Last Release

1473d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62e7f97fccdea13b7593c4af2e06b0971fe199b402d5429e2f5df91bf5bc12fb?d=identicon)[cagartner1](/maintainers/cagartner1)

---

Top Contributors

[![stackpr](https://avatars.githubusercontent.com/u/1994413?v=4)](https://github.com/stackpr "stackpr (28 commits)")[![cagartner](https://avatars.githubusercontent.com/u/4007696?v=4)](https://github.com/cagartner "cagartner (14 commits)")[![electrolinux](https://avatars.githubusercontent.com/u/601587?v=4)](https://github.com/electrolinux "electrolinux (4 commits)")[![qris](https://avatars.githubusercontent.com/u/754175?v=4)](https://github.com/qris "qris (3 commits)")[![TobiaszCudnik](https://avatars.githubusercontent.com/u/93027?v=4)](https://github.com/TobiaszCudnik "TobiaszCudnik (2 commits)")[![ianitsky](https://avatars.githubusercontent.com/u/163327?v=4)](https://github.com/ianitsky "ianitsky (2 commits)")[![panrafal](https://avatars.githubusercontent.com/u/1268900?v=4)](https://github.com/panrafal "panrafal (2 commits)")[![roalvesrj](https://avatars.githubusercontent.com/u/13507838?v=4)](https://github.com/roalvesrj "roalvesrj (1 commits)")[![lsowen](https://avatars.githubusercontent.com/u/1014577?v=4)](https://github.com/lsowen "lsowen (1 commits)")[![lada](https://avatars.githubusercontent.com/u/179279?v=4)](https://github.com/lada "lada (1 commits)")

### Embed Badge

![Health badge](/badges/cagartner-phpquery/health.svg)

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

###  Alternatives

[lullabot/amp

A set of useful classes and utilities to convert html to AMP html (See https://www.ampproject.org/)

3793.0M11](/packages/lullabot-amp)[padaliyajay/php-autoprefixer

CSS Autoprefixer written in pure PHP.

478.5M10](/packages/padaliyajay-php-autoprefixer)[northys/css-inliner

PHP Library that converts css file into html inline styles.

4316.8k](/packages/northys-css-inliner)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[drupaljedi/css-tree-shaking

Helps you to eliminate the portions of CSS you aren't using. Usually should be used to generate AMP pages, where is the fixed limit for maximum styles size.

1222.5k](/packages/drupaljedi-css-tree-shaking)

PHPackages © 2026

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