reverse htmlspecialchars

前端 未结 4 1731
梦毁少年i
梦毁少年i 2020-12-05 17:40

this may seem like a simple problem but I couldn\'t find it in the archives.

how does one reverse the effects of htmlspecialchars?

I tried something like thi

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 17:54

    Use htmlspecialchars_decode()

    this -> "

    \n"; echo htmlspecialchars_decode($str); // note that here the quotes aren't converted echo htmlspecialchars_decode($str, ENT_NOQUOTES); ?>

    Reference - PHP Official Doc

提交回复
热议问题