Home > Backend Development > PHP Tutorial > 怎么将php的cookie转化成对象或数组?

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

WBOY
Release: 2016-06-23 14:04:24
Original
1343 people have browsed it

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


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


回复讨论(解决方案)


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

?>

php.ini中,magic_quotes_gpc = on

改成magic_quotes_gpc = off

就没转义符了

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