Home > Backend Development > PHP Tutorial > PHP encryption and decryption functions (Chinese is not supported)

PHP encryption and decryption functions (Chinese is not supported)

WBOY
Release: 2016-07-25 09:04:24
Original
1229 people have browsed it
  1. /*
  2. @名称:PHP加密/解密
  3. @link:bbs.it-home.org
  4. @date:2013/2/28
  5. */
  6. function phpencode($code) {
  7. $code = str_replace(array('',' $encode = base64_encode(gzdeflate($code)); // 开始编码
  8. $encode = '";
  9. return $encode;
  10. }
  11. function phpdecode($code) {
  12. $code = str_replace(array(''),array('','','','','',''),$code);
  13. $decode = base64_decode($code);
  14. $decode = @gzinflate($decode);
  15. return $decode;
  16. }
  17. ?>
  18. PHP加密/解密
  19. PHP加密/解密

  20. if(!emptyempty($_POST['source'])){
  21. if($_POST['button']=='加密') {
  22. echo '

    加密成功.';
  23. }
  24. if($_POST['button']=='解密') {
  25. echo '

    解密成功.';
  26. }
  27. }else{
  28. echo '

    利用 base64+gzinflate 对您的php代码进行压缩,可以一定程度上保护您的代码版权和减小代码的体积。';
  29. }
  30. ?>


Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template