php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
php-simple-html-dom-parser for PHP7.3 +
If you use php 7.3 and higher, then use my edits. Otherwise, you will get errors due to migration to PCRE2 in new versions of PHP.
For example: Warning: preg_match_all (): Compilation failed: invalid range in character class at offset 4
Yep, it's the new strict PCRE2 caused by regex
\w-:
which should be
\w\-:
Here is the simple snippet used in php.net
preg_match('/[\w-.]+/', ''); // this will not work in PHP7.3
preg_match('/[\w\-.]+/', ''); // the hyphen need to be escaped