Heim >Backend-Entwicklung >PHP-Tutorial >怎么将php的cookie转化成对象或数组?
怎么将php的cookie转化成对象或数组?
<?php echo $_COOKIE['drres']; /* ------- 得到这样的字符串"{\"filter_last\":\"category\",\"user_last\":\"linjuming@xx.com\"}" 怎么转化成数组或对象啊? ------- */?>
print_r(json_decode("{\"filter_last\":\"category\",\"user_last\":\"linjuming@xx.com\"}"));
?>
php.ini中,magic_quotes_gpc = on
改成magic_quotes_gpc = off
就没转义符了