PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.1.13
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.1.13
4.1.20 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 All 174 releases
searchpro / BerqWP / vendor / voku / simple_html_dom / README.md

README.md in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript 4.1.13, at BerqWP/vendor/voku/simple_html_dom/README.md

82 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 [](https://github.com/voku/simple_html_dom/actions![Build Status](https://github.com/voku/simple_html_dom/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/simple_html_dom/actions](https://github.com/voku/simple_html_dom/actions)
2 [](https://coveralls.io/github/voku/simple_html_dom?branch=master![Coverage Status](https://coveralls.io/repos/github/voku/simple_html_dom/badge.svg?branch=master)](https://coveralls.io/github/voku/simple_html_dom?branch=master](https://coveralls.io/github/voku/simple_html_dom?branch=master)
3 [](https://www.codacy.com/app/voku/simple_html_dom?utm_source=github.com&utm_medium=referral&utm_content=voku/simple_html_dom&utm_campaign=Badge_Grade![Codacy Badge](https://api.codacy.com/project/badge/Grade/3290fdc35c8f49ad9abdf053582466eb)](https://www.codacy.com/app/voku/simple_html_dom?utm_source=github.com&utm_medium=referral&utm_content=voku/simple_html_dom&utm_campaign=Badge_Grade](https://www.codacy.com/app/voku/simple_html_dom?utm_source=github.com&utm_medium=referral&utm_content=voku/simple_html_dom&utm_campaign=Badge_Grade)
4 [](https://packagist.org/packages/voku/simple_html_dom![Latest Stable Version](https://poser.pugx.org/voku/simple_html_dom/v/stable)](https://packagist.org/packages/voku/simple_html_dom](https://packagist.org/packages/voku/simple_html_dom)
5 [](https://packagist.org/packages/voku/simple_html_dom![Total Downloads](https://poser.pugx.org/voku/simple_html_dom/downloads)](https://packagist.org/packages/voku/simple_html_dom](https://packagist.org/packages/voku/simple_html_dom)
6 [](https://packagist.org/packages/voku/simple_html_dom![License](https://poser.pugx.org/voku/simple_html_dom/license)](https://packagist.org/packages/voku/simple_html_dom](https://packagist.org/packages/voku/simple_html_dom)
7 [](https://www.paypal.me/moelleken![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken](https://www.paypal.me/moelleken)
8 [](https://www.patreon.com/voku![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku](https://www.patreon.com/voku)
9
10 # :scroll: Simple Html Dom Parser for PHP
11
12 A HTML DOM parser written in PHP - let you manipulate HTML in a very easy way!
13 This is a fork of [](http://simplehtmldom.sourceforge.net/PHP Simple HTML DOM Parser project](http://simplehtmldom.sourceforge.net/](http://simplehtmldom.sourceforge.net/) but instead of string manipulation we use DOMDocument and modern php classes like "Symfony CssSelector".
14
15 - PHP 7.0+ & 8.0 Support
16 - PHP-FIG Standard
17 - Composer & PSR-4 support
18 - PHPUnit testing via Travis CI
19 - PHP-Quality testing via SensioLabsInsight
20 - UTF-8 Support (more support via "voku/portable-utf8")
21 - Invalid HTML Support (partly ...)
22 - Find tags on an HTML page with selectors just like jQuery
23 - Extract contents from HTML in a single line
24
25
26 ### Install via "composer require"
27
28 ```shell
29 composer require voku/simple_html_dom
30 composer require voku/portable-utf8 # if you need e.g. UTF-8 fixed output
31 ```
32
33 ### Quick Start
34
35 ```php
36 use voku\helper\HtmlDomParser;
37
38 require_once 'composer/autoload.php';
39
40 ...
41 $dom = HtmlDomParser::str_get_html($str);
42 // or
43 $dom = HtmlDomParser::file_get_html($file);
44
45 $element = $dom->findOne('#css-selector'); // "$element" === instance of "SimpleHtmlDomInterface"
46
47 $elements = $dom->findMulti('.css-selector'); // "$elements" === instance of SimpleHtmlDomNodeInterface<int, SimpleHtmlDomInterface>
48
49 $elementOrFalse = $dom->findOneOrFalse('#css-selector'); // "$elementOrFalse" === instance of "SimpleHtmlDomInterface" or false
50
51 $elementsOrFalse = $dom->findMultiOrFalse('.css-selector'); // "$elementsOrFalse" === instance of SimpleHtmlDomNodeInterface<int, SimpleHtmlDomInterface> or false
52 ...
53
54 ```
55
56 ### Examples
57
58 [](https://github.com/voku/simple_html_dom/tree/master/examplegithub.com/voku/simple_html_dom/tree/master/example](https://github.com/voku/simple_html_dom/tree/master/example](https://github.com/voku/simple_html_dom/tree/master/example)
59
60 ### API
61
62 [](https://github.com/voku/simple_html_dom/tree/master/README_API.mdgithub.com/voku/simple_html_dom/tree/master/README_API.md](https://github.com/voku/simple_html_dom/tree/master/README_API.md](https://github.com/voku/simple_html_dom/tree/master/README_API.md)
63
64 ### Support
65
66 For support and donations please visit [](https://github.com/voku/simple_html_dom/Github](https://github.com/voku/simple_html_dom/](https://github.com/voku/simple_html_dom/) | [](https://github.com/voku/simple_html_dom/issuesIssues](https://github.com/voku/simple_html_dom/issues](https://github.com/voku/simple_html_dom/issues) | [](https://paypal.me/moellekenPayPal](https://paypal.me/moelleken](https://paypal.me/moelleken) | [](https://www.patreon.com/vokuPatreon](https://www.patreon.com/voku](https://www.patreon.com/voku).
67
68 For status updates and release announcements please visit [](https://github.com/voku/simple_html_dom/releasesReleases](https://github.com/voku/simple_html_dom/releases](https://github.com/voku/simple_html_dom/releases) | [](https://twitter.com/suckup_deTwitter](https://twitter.com/suckup_de](https://twitter.com/suckup_de) | [](https://www.patreon.com/voku/postsPatreon](https://www.patreon.com/voku/posts](https://www.patreon.com/voku/posts).
69
70 For professional support please contact [](https://about.me/vokume](https://about.me/voku](https://about.me/voku).
71
72 ### Thanks
73
74 - Thanks to [](https://github.comGitHub](https://github.com](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
75 - Thanks to [](https://www.jetbrains.comIntelliJ](https://www.jetbrains.com](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
76 - Thanks to [](https://travis-ci.com/Travis CI](https://travis-ci.com/](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
77 - Thanks to [](https://styleci.io/StyleCI](https://styleci.io/](https://styleci.io/) for the simple but powerfull code style check.
78 - Thanks to [](https://github.com/phpstan/phpstanPHPStan](https://github.com/phpstan/phpstan](https://github.com/phpstan/phpstan) && [](https://github.com/vimeo/psalmPsalm](https://github.com/vimeo/psalm](https://github.com/vimeo/psalm) for relly great Static analysis tools and for discover bugs in the code!
79
80 ### License
81 [](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple_html_dom?ref=badge_large![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fvoku%2Fsimple_html_dom.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple_html_dom?ref=badge_large](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple_html_dom?ref=badge_large)
82