Working with PHP DOM – HTML manipulation.
Got 2 questions
- Recently read that, there is better way to output special html characters (e.g. ©):
DOMDocument::createEntityReference()method. Main advantage is, you don’t need to usehtmlentities, it will be automatically escaped.
For ex:$copyright_symbol = $document->createEntityReference("copy");.
Now, the problem is, where can I find characters’ code reference? In my case I need php equalent of×(× symbol) - What if I want to set muliple classes to element? Can I do it like that
$el->setAttribute('class', 'class1 class2 ...')??
here you can see character codes as well as friendly names. For your ×, you will use “times”
and for the second question, yes, you can do it like that.