首页 >后端开发 >php教程 > 如何将php的cookie转化成对象或数组

如何将php的cookie转化成对象或数组

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-13 12:57:201082浏览

怎么将php的cookie转化成对象或数组?
怎么将php的cookie转化成对象或数组?


<?php<br />
    echo $_COOKIE['drres'];<br />
    /* -------<br />
        得到这样的字符串"{\"filter_last\":\"category\",\"user_last\":\"linjuming@xx.com\"}"<br />
        怎么转化成数组或对象啊?<br />
    ------- */<br />
?>


------解决方案--------------------

print_r(json_decode("{\"filter_last\":\"category\",\"user_last\":\"linjuming@xx.com\"}"));

?>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn