Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: max(one, six)?
(Example: nine)

The Note You're Voting On

dignat at yahoo dot com
7 years ago
To create an element with DomDocument and to escape ampersand in the value.

Do this:

$element = new DOMDocument('1.0', 'UTF-8');

$test = $element->createElement('text');

$test ->appendChild($element->createElement('name'))
->appendChild($element->createtextNode('& I am ampersand');

<< Back to user notes page

To Top