【问题标题】:how to echo ascii encrypted text in php如何在php中回显ascii加密文本
【发布时间】:2011-11-29 07:48:33
【问题描述】:

我正在尝试回显这样的 ascii 加密文本:

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

加密函数返回

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

但在屏幕上打印为“你好”。

如何打印原始 ascii 值?

【问题讨论】:

  • 删除了加密标签以支持 [character-encoding] 和 [escaping],因为加密标签仅限于加密意义上的加密(PHP 函数在我的意见)

标签: php javascript character-encoding escaping ascii


【解决方案1】:

您可以在加密周围使用htmlentities() 来转义&。

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

【讨论】:

  • 这是完美的..!需要再等 8 分钟才能接受这个结果!
【解决方案2】:
$x = encrypt("hello there");
echo htmlentities($x);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    • 2018-05-21
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多