HTML,PHP - Escape '<' and '>' symbols while echoing

后端 未结 8 1815
旧巷少年郎
旧巷少年郎 2020-12-02 00:15

I want to print following text as it is:

echo \"

But it is just showing \'AAAAA\' as output.

How can I esca

相关标签:
8条回答
  • 2020-12-02 00:43

    check this http://php.net/manual/en/function.htmlentities.php, and this is code -

    echo htmlentities ("<label> AAAAA");
    
    0 讨论(0)
  • 2020-12-02 00:46
    <?php
        $string = "<label> AAAAA"; //whatever you want
        echo htmlspecialchars($string);
    ?>
    

    refrence htmlspecialchars

    0 讨论(0)
提交回复
热议问题