Print less-than and greater-than symbols in PHP

后端 未结 7 720
南方客
南方客 2020-12-01 16:01

I am have troubles trying to print out < > symbols in HTML using PHP.

I am appending a string \"\" to a v

相关标签:
7条回答
  • 2020-12-01 17:04

    The < and > symbols should be shown in the HTML source but the "<machine>" is interpreted as XML tag. Use htmlentities() to convert all special characters in the String into their HTML-equivalents, or use "&lt;machine&gt;"

    Solution:

    $output .= " <machine> ";
    $output = htmlentites($output);
    echo $output;
    
    0 讨论(0)
提交回复
热议问题