DOMDocument help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using php 5.2.5 with the php-xml module.

I need to split a string of html into elements.

IE -

this <b>is</b> a string <b>that</b> has some bold <b>words</b> in it.

I need to be able to take that string and split it up into textNodes for the parts that are not in bold text, and bold nodes containing the bold elements.

I've tried creating a new DOMDocument object and inputing the line into it -

$tmpNode = new DOMDocument;
$tmpNode->loadHTML($string);

but I can't figure out how to get the the useful nodes out of it to then append as children in the document I'm creating.

Any tips on how to do this?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux