@ 2014-04-16T18:16:13Z <?php
$body = '<div class="cModule myphotos">
<h3><span>My photos</span></h3>
<ul class="cResetList cThumbList clrfix">
<li>
<a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=67" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" title="Uploaded by shine s" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_05c0beeb8f0f32a08538dad7.jpg" alt="shine s"></a>
</li>
<li>
<a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=43" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_c122ff8dafd2edeba377a1cd.jpg" alt="shine s" original-title="Uploaded by shine s"></a>
</li>
<li>
<a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=66" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" title="Uploaded by shine s" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_9414b5dff6c8644d197ff684.jpg" alt="shine s"></a>
</li>
</ul>
<div class="app-box-footer">
<a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos" hidefocus="true" style="outline: none;">View all photos</a>
</div>
</div>';
$xml = new DOMDocument();
$xml->loadHTML($body);
$nodes = $xml->getElementsByTagName('li');
for($curr = 0; $curr < $nodes->length; $curr++) {
$li = $nodes->item($curr);
print $li->nodeValue . "\n";
foreach($li->childNodes as $child) {
$a = $child;
var_dump($child);
$href = $a->getAttribute('href');
print "{$href}\n";
}
print "\n";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.3.0 - 8.3.7
object(DOMText)#6 (23) {
["wholeText"]=>
string(11) "
"
["data"]=>
string(11) "
"
["length"]=>
int(11)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(5) "#text"
["nodeValue"]=>
string(11) "
"
["nodeType"]=>
int(3)
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
NULL
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(11) "
"
}
Fatal error: Uncaught Error: Call to undefined method DOMText::getAttribute() in /in/bg0GU:39
Stack trace:
#0 {main}
thrown in /in/bg0GU on line 39
Process exited with code 255 . Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.19
object(DOMText)#6 (21) {
["wholeText"]=>
string(11) "
"
["data"]=>
string(11) "
"
["length"]=>
int(11)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(5) "#text"
["nodeValue"]=>
string(11) "
"
["nodeType"]=>
int(3)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(11) "
"
}
Fatal error: Uncaught Error: Call to undefined method DOMText::getAttribute() in /in/bg0GU:39
Stack trace:
#0 {main}
thrown in /in/bg0GU on line 39
Process exited with code 255 . Output for 7.3.16 - 7.3.33 , 7.4.4 - 7.4.33
object(DOMText)#6 (19) {
["wholeText"]=>
string(11) "
"
["data"]=>
string(11) "
"
["length"]=>
int(11)
["nodeName"]=>
string(5) "#text"
["nodeValue"]=>
string(11) "
"
["nodeType"]=>
int(3)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(11) "
"
}
Fatal error: Uncaught Error: Call to undefined method DOMText::getAttribute() in /in/bg0GU:39
Stack trace:
#0 {main}
thrown in /in/bg0GU on line 39
Process exited with code 255 . Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.12 , 7.4.0 - 7.4.3
object(DOMText)#6 (19) {
["wholeText"]=>
string(11) "
"
["data"]=>
string(11) "
"
["length"]=>
int(11)
["nodeName"]=>
string(5) "#text"
["nodeValue"]=>
string(11) "
"
["nodeType"]=>
int(3)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
NULL
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(11) "
"
}
Fatal error: Uncaught Error: Call to undefined method DOMText::getAttribute() in /in/bg0GU:39
Stack trace:
#0 {main}
thrown in /in/bg0GU on line 39
Process exited with code 255 . Output for 5.3.11 - 5.3.29 , 5.4.1 - 5.4.45 , 5.5.0 - 5.5.35 , 5.6.0 - 5.6.28
object(DOMText)#5 (19) {
["wholeText"]=>
string(11) "
"
["data"]=>
string(11) "
"
["length"]=>
int(11)
["nodeName"]=>
string(5) "#text"
["nodeValue"]=>
string(11) "
"
["nodeType"]=>
int(3)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
NULL
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(11) "
"
}
Fatal error: Call to undefined method DOMText::getAttribute() in /in/bg0GU on line 39
Process exited with code 255 . Output for 5.2.3 - 5.2.17 , 5.3.0 - 5.3.10 , 5.4.0
object(DOMText)#5 (0) {
}
Fatal error: Call to undefined method DOMText::getAttribute() in /in/bg0GU on line 39
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.2
object(DOMText)#5 (0) {
}
<br />
<b>Fatal error</b>: Call to undefined method DOMText::getAttribute() in <b>/in/bg0GU</b> on line <b>39</b><br />
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.9 <br />
<b>Fatal error</b>: Cannot instantiate non-existent class: domdocument in <b>/in/bg0GU</b> on line <b>24</b><br />
Process exited with code 255 . Output for 4.3.0 - 4.3.1 <br />
<b>Fatal error</b>: Cannot instantiate non-existent class: domdocument in <b>/in/bg0GU</b> on line <b>24</b><br />
preferences:dark mode live preview
239.33 ms | 402 KiB | 347 Q