php5 need something like innerHTML instead of nodeValue
I am using cURL and xpath to get data from an html page and everything is going well until I encounter a node like this:
so I curl the page and setup my xpath like this:
The first bit of Data I want
<br>The second bit of Data I want
<br>The third bit of Data I want</td>
which gives me something like:
$fooNode = $xpath->evaluate("/html/body//td[@id='foo'];
$fooString = $fooNode->item(0)->nodeValue;
"The first bit of Data I wantThe second bit of Data I wantThe third bit of Data I want"
as a result with no way to separate the data (before you ask the data above is just an example, can't explode the string via "The")
What I would like instead is some way to return the node with markup intact sorta like innerHTML in js, so I can explode it to an array via the "<br>" tag. like:
"The first bit of Data I want<br>The second bit of Data I want<br>The third bit of Data I want"
Is there anyway to save a node as a string with <br> tags intact?
Forgive me if this has been answered before, I did look around the site and Googled all last night to no avail.