Comparison: native PHP DOM Extension instead of simple html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lin
Forum Commoner
Posts: 49
Joined: Tue Dec 07, 2010 1:53 pm

Comparison: native PHP DOM Extension instead of simple html

Post by lin »

good day dear community,


well i want to parse the site here:

http://buergerstiftungen.de/cps/rde/xch ... xsl/db.htm

I suggest to use the native PHP "DOM" Extension instead of "simple html parser", it will be much faster and easier ;)

What do you think about this one here...:

Code: Select all

$doc = new DOMDocument
@$doc->loadHTMLFile('...URL....'); // Using the @ operator to hide parse errors
$contents = $doc->getElementById('content')->nodeValue; // Text contents of #content

Well what do you think - is this a good decision!? i look forward to hear from you!

greetings :)
Post Reply