Tag archive for "dom"

Extract HTML with PHP’s DOM extension

I recently had to parse HTML with PHP and had a look at PHP's DOM at last. Here's a way to extract an element's content by ID: <?php /** * Extract an element by ID from an HTML document * Thanks http://codjng.blogspot.com/2009/10/unicode-problem-when-using-domdocument.html * * @param string $content A website * ... more