Download the PHP package mathsgod/p-query without Composer
On this page you can find all versions of the php package mathsgod/p-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mathsgod/p-query
More information about mathsgod/p-query
Files in mathsgod/p-query
Download mathsgod/p-query
More information about mathsgod/p-query
Files in mathsgod/p-query
Vendor mathsgod
Package p-query
Short Description Using jQuery liked method to parse html by using php
License MIT
Package p-query
Short Description Using jQuery liked method to parse html by using php
License MIT
Please rate this library. Is it a good library?
Informations about the package p-query
Introduction
PQuery is a PHP library that lets you parse and manipulate HTML strings using a jQuery-like API. It is built on top of PHP's native DOM extension and uses Symfony's CSS Selector component for selector support.
Requirements
- PHP ^8.3
ext-dom- Composer
Installation
Quick Start
PQuery Supported Methods
size()/count()— number of matched elementsfirst()/last()— get the first or last matched elementhtml()— get or set inner HTMLtext()— get or set text contentappend()/prepend()— insert content to each elementappendTo()/prependTo()— insert elements into targetafter()/before()— insert content adjacent to elementsremove()— remove elements from the documentfind()— search descendants by CSS selectorclosest()/parent()/children()/contents()— traverse the DOMattr()/removeAttr()— get or set attributesaddClass()/removeClass()/toggleClass()/hasClass()— class manipulationcss()— get or set inline stylesdata()— get or set data attributesval()— get or set form valuesfilter()— reduce the matched seteach()— iterate over matched elementsreplaceWith()/wrap()/wrapInner()— replace or wrap elementsprev()/next()/index()— sibling and position helperson()/trigger()— event listener helpers
CSS Selector Support
Use any valid CSS selector with find() and filter():
Working with HTML Elements
Create and style elements directly:
Append an element
Append text
Append an element and text
Parse HTML from a File
Events
Attach and trigger event listeners on elements:
Running Tests
Tests are run automatically on GitHub Actions against PHP 8.3, 8.4, and 8.5.
License
MIT
Created by Raymond Chong
All versions of p-query with dependencies
PHP Build Version
Package Version
The package mathsgod/p-query contains the following files
Loading the files please wait ...