Escape quotes in a variable with PHP

后端 未结 7 671
温柔的废话
温柔的废话 2021-01-12 03:16

I use this code to genefate html

echo \"\";

Everything would be OK unles

7条回答
  •  心在旅途
    2021-01-12 03:26

    If you are relying on user input, use htmlentities($param, ENT_QUOTES);

    See http://uk.php.net/manual/en/function.htmlentities.php

提交回复
热议问题