Home  >  Article  >  Backend Development  >  如何将php的cookie转化成对象或数组

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

WBOY
WBOYOriginal
2016-06-13 11:10:191333browse

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


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


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

print_r(json_decode("{\"filter_last\":\"category\",\"user_last\":\"[email protected]\"}"));

?>
Statement:
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