简体   繁体   中英

how to echo ascii encrypted text in php

I am trying to echo an ascii crypted text like this:

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

the encrypt function returns

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

but on the screen it is printed as "hello there".

how can i print the original ascii value ?

You can use htmlentities() around encrypt to escape the &.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM