Answer the question
In order to leave comments, you need to log in
Miracles with BLOWFISH inside JSON
Here is my code:
$message = mcrypt_ecb(MCRYPT_BLOWFISH, 12344532523532, $message, MCRYPT_ENCRYPT);
$answer = array("message"=>$message, "code"=>$code);
var_dump($answer);
echo json_encode($answer);
exit();
array(2) {
["message"]=> string(24) "zС”Э»Пі^cptO«q[email protected]Юн "
["code"]=> int(1)
}
{"message":null,"code":1}
Answer the question
In order to leave comments, you need to log in
The JSON parser may fall silent if it cannot recognize the encoding. Especially in the encoded data at the end of the padding of \0, which is not text at all. Pack in base64.
What are you reading? In the browser?
Tell me, where do such miracles come from? json eats characters unknown to it?
And if you do so?
echo json_encode($answer,JSON_UNESCAPED_UNICODE);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question