Skip to content
tobiasz.cudnik edited this page Oct 20, 2008 · 4 revisions

Table of Contents

Example

Table of Contents

 * [#Loading_documents Loading documents]
 * [#pq_function pq() function]

Loading documents

 * phpQuery::*newDocument*($html, $contentType = null) Creates new document from markup. If no $contentType, autodetection is made (based on markup). If it fails, text/html in utf-8 is used.
 * phpQuery::*newDocumentFile*($file, $contentType = null) Creates new document from file. Works like newDocument()
 * phpQuery::*newDocumentHTML*($html, $charset = 'utf-8')
 * phpQuery::*newDocumentXHTML*($html, $charset = 'utf-8')
 * phpQuery::*newDocumentXML*($html, $charset = 'utf-8')
 * phpQuery::*newDocumentPHP*($html, $contentType = null) Read more about it on [http://code.google.com/p/phpquery/wiki/PHPSupport PHPSupport page]
 * phpQuery::*newDocumentFileHTML*($file, $charset = 'utf-8')
 * phpQuery::*newDocumentFileXHTML*($file, $charset = 'utf-8')
 * phpQuery::*newDocumentFileXML*($file, $charset = 'utf-8')
 * phpQuery::*newDocumentFilePHP*($file, $contentType) Read more about it on [http://code.google.com/p/phpquery/wiki/PHPSupport PHPSupport page]

pq function

  • `pq($param, $context = null);`*
  • pq();* function is equivalent of jQuery's *$();*. It's used for 3 type of things:
 # Importing markup
 # Running queries
 # Wrapping DOMNodes with phpQuery objects
Clone this wiki locally