The Little Guy Posted September 27, 2010 Share Posted September 27, 2010 I am trying to unserialize this string: a:3:{s:3:\"zip\";s:5:\"55068\";s:4:\"city\";s:9:\"Rosemount\";s:5:\"state\";s:2:\"MN\";} but I unserialize is returning false. Why is it doing that? $info = unserialize($_COOKIE['zipcode']); var_dump($info); Quote Link to comment https://forums.phpfreaks.com/topic/214494-unserialize-returns-false/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 27, 2010 Share Posted September 27, 2010 That's because the data was escaped by php's brilliant magic_quotes_gpc (c=cookie) If magic_quotes_gpc is on, you should either - A) turn it off, or B) use stripslashes() on the data. Quote Link to comment https://forums.phpfreaks.com/topic/214494-unserialize-returns-false/#findComment-1116135 Share on other sites More sharing options...
The Little Guy Posted September 27, 2010 Author Share Posted September 27, 2010 hmm... wonder how that happened... I moved from a public server to my private server... Quote Link to comment https://forums.phpfreaks.com/topic/214494-unserialize-returns-false/#findComment-1116137 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.