phpQuery - pq(); phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library. Library is written in PHP5 and provides Command Line Interface (CLI). Manual * Basics * Ported jQuery sections * Selectors * Attributes * Traversing * Manipulation * Ajax * Events * Utilities * Plugin ports * PHP Support * Command Line Interface * Multi document support * Plugins * WebBrowser * Scripts * jQueryServer * Debugging * Bootstrap file Download * Release packages (rss) * ZIP format * RPM format * Release notes * Bugs: active / fixed * Dependencies * SVN checkout Documentation * Wiki * Manual * API reference * jQuery documentation wiki * CHM version * CheatSheet Publications * Official blog with latest release notes * Author's blog with examples and new feature sneak peaks * Roadmap: Planned / Done Feedback * Issue/Bug Tracker (new issue) * Google Group * IRC #phpquery at freenode.net * ohloh.net has phpQuery project Examples CLI Fetch number of downloads of all release packages phpquery 'http://code.google.com/p/phpquery/downloads/list?can=1' \ --find '.vt.col_4 a' --contents \ --getString null array_sum PHP Examples from demo.php require('phpQuery/phpQuery.php'); INITIALIZE IT // $doc = phpQuery::newDocumentHTML($markup); // $doc = phpQuery::newDocumentXML(); // $doc = phpQuery::newDocumentFileXHTML('test.html'); // $doc = phpQuery::newDocumentFilePHP('test.php'); // $doc = phpQuery::newDocument('test.xml', 'application/rss+xml'); // this one defaults to text/html in utf8 $doc = phpQuery::newDocument('
'); FILL IT // array syntax works like ->find() here $doc['div']->append('