与PHP DOM合作——超文本处理。
2个问题
- 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 ... )
??