You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
489 B

  1. <?php
  2. namespace Kuxin\Helper;
  3. /**
  4. * Class Serialize
  5. *
  6. * @package Kuxin\Helper
  7. * @author Pakey <pakey@qq.com>
  8. */
  9. class Serialize
  10. {
  11. /**
  12. * 序列化
  13. *
  14. * @param $data
  15. * @return string
  16. */
  17. public static function encode($data)
  18. {
  19. return serialize($data);
  20. }
  21. /**
  22. * 反序列化
  23. *
  24. * @param $data
  25. * @return mixed
  26. */
  27. public static function decode($data)
  28. {
  29. return unserialize($data);
  30. }
  31. }