如何在php中回显ASCII加密文本


how to echo ascii encrypted text in php

我试图像这样回显ascii加密文本:

$x = encrypt("hello there");
 echo $x;

加密函数返回

&#104&#101&#108&#108&#111&#32&#116&#104&#101&#114&#101

但是在屏幕上显示为"hello there"

如何打印原始ASCII值

您可以在encrypt周围使用htmlentities()来转义&

$x = htmlentities(encrypt("hello there"));
 echo $x;
$x = encrypt("hello there");
echo htmlentities($x);