DomDocument and html entities

前端 未结 4 507
臣服心动
臣服心动 2021-01-03 06:38

I\'m trying to parse some HTML that includes some HTML entities, like ×

$str = \' A × B\';

$do         


        
4条回答
  •  清歌不尽
    2021-01-03 06:51

    This is no direct answer to the question, but you may use UTF-8 instead, which allows you to save glyphs like ÷ or × directly. To use UTF-8 with PHP DOM on the other needs a little hack.

    Also, if you are trying to display mathematical formulas (as A × B suggests) have a look at MathML.

提交回复
热议问题