官網有警告說:This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged.
那麼加密解密用什麼函數呢?
仅有的幸福2017-05-16 13:18:22
openssl_encrypt
openssl_decrypt
>>> openssl_encrypt("1", "aes-256-cbc", "12312321", 0, "1234123443212345");
=> "x6Zfu2cbtbMDfkt2s/GE2A=="
>>> openssl_decrypt("x6Zfu2cbtbMDfkt2s/GE2A==", "aes-256-cbc", "12312321", 0, "1234123443212345");
=> "1"
另可參閱 How do you Encrypt and Decrypt a PHP String?