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

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

phpquery/phpquery
=================

jquery for php

0.0.5(3mo ago)8155.5k↓16.9%23BeerwarePHP

Since Apr 21Pushed 3mo ago2 watchersCompare

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

READMEChangelogDependenciesVersions (6)Used By (3)

phpquery
========

[](#phpquery)

jquery for php
--------------

[](#jquery-for-php)

This is a simple wrapper over the xpath library that lets you make queries on an html page with the more friendly syntax of *jquery*.

you can use it also to make queries with the *xpath* syntax

### public functions

[](#public-functions)

```
load_str($html_string);
query($query_string,$relative_path); // returns DOMNodeList or DOMElement
xpath($query_string,$relative_path); // returns DOMNodeList or DOMElement
j_to_x($query_string);
innerHTML(DOMElement); // returns string
outerHTML(DOMElement); //return string

```

where `$relative_path` is optional and represent a saved query performed earlier.

### usage

[](#usage)

```
