Unable to get nodeValue using DOMDocument class in PHP
Posted
by Harish
on Stack Overflow
See other posts from Stack Overflow
or by Harish
Published on 2010-04-24T05:29:46Z
Indexed on
2010/04/24
5:33 UTC
Read the original article
Hit count: 233
I am Parsing a HTML document using DOMDocument Class in PHP, i wanted to get the nodeValue of a div element, but it is giving me null,
<div id="summary">
Hi, my name is <span>ABC</span>
<br/>
address is here at stackoverflow...
<span>....
....
<div>
want to get the value inside the div, and the code i wrote wass
$div_node=$dom->getElementById("summary");
$node_value=$div_node->nodeValue;
but it is giving me a null value, please help.
© Stack Overflow or respective owner