这是我直接回显cookie时显示的输出,然后尝试json_decode它。
$_COOKIE['mycookie'] = {\"table_name\":\"wp_customtable\",\"time\":\"2013-09-26 08:18:23\",\"post_id\":null,\"referer\":\"www.bing.com\",\"keywords\":\"350 rear main seal replacement 11\",\"full_referrer\":\"http:\\/\\/www.bing.com\\/search?q=350+rear+main+seal+replacement+11&go=&qs=n&form=QBRE&pq=350+rear+main+seal+replacement+11&sc=0-32&sp=-1&sk=&cvid=dc09d67a2d214c8394bd39f2b28cf6cc\",\"ip\":\"123.45.67.89\"}
$cookie = $_COOKIE['mycookie'];
$output = json_decode($cookie, true);
var_dump($cookie);
string(392) "{\"table_name\":\"wp_customtable\",\"time\":\"2013-09-26 08:18:23\",\"post_id\":null,\"referer\":\"www.bing.com\",\"keywords\":\"350 rear main seal replacement 11\",\"full_referrer\":\"http:\\/\\/www.bing.com\\/search?q=350+rear+main+seal+replacement+11&go=&qs=n&form=QBRE&pq=350+rear+main+seal+replacement+11&sc=0-32&sp=-1&sk=&cvid=dc09d67a2d214c8394bd39f2b28cf6cc\",\"ip\":\"123.45.67.89\"}
var_dump($output);
NULL