PHP 8.5.0 Alpha 4 available for testing

Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

anthony dot parsons at manx dot net
17 years ago
If you're handling lots of HTML or mixed-content XML you'll probably want to use the DOM functions instead of SimpleXML. Take this for example:
<?php
$html
= new SimpleXMLElement('<div><p>Some text, <a href="#">a link,</a> more text</p></div>');

echo
$html->p->a,"<br>\n"; // "a link,"
echo $html->p; // "Some text, more text" (!)
?>
In the above example reconstructing the original markup is impossible because of the way SimpleXML represents the data.

<< Back to user notes page

To Top