php 写入和读取序列化的cookie

  

  
    public  function saveConfigToCookie(array    $config){
         setcookie("c", urlencode(serialize(($config))), time() + 9999999, "/");
    }



 
 
     public  function loadCookieConfig() {
         $configCookieVal = $_COOKIE['c'];
         $configArray = unserialize(urldecode($configCookieVal));
         return $configArray;
    }

你可能感兴趣的:(java,C++,c,PHP,C#)