How to display XML in HTML in PHP?

后端 未结 5 1951
南笙
南笙 2020-11-28 10:40

I have a string with XML:

$string = 
\"

    
       Shoue
    

\";
<         


        
5条回答
  •  感情败类
    2020-11-28 11:13

    If you just want a plain-text representation of your (pre-formatted) string, you can wrap it in HTML

     tags and use htmlentities to escape the angle brackets:

    ', htmlentities($string), '
    '; ?>

提交回复
热议问题