Stack Overflow
Stack Overflow

Reputation: 247

why does unserialize keep returning false even after using stripslashes

$question_data contains this string string(163) "a:5:{s:7:"form_id";s:1:"4";s:5:"title";s:7:"Aurelie";s:9:"text_area";s:22:"dfgdfsgfdgfdgfdgdfgfdg";s:7:"options";s:10:"First Name";s:6:"degree";s:11:"Bachelor's";}"

unserialize($question_data) keeps returning false

Upvotes: 0

Views: 92

Answers (1)

r3mainer
r3mainer

Reputation: 24567

Your problem is with s:11:"Bachelor's";

The string is declared as being 11 characters in length, but you only have 10 there. I suspect the original data was s:11:"Bachelor\\'s"; and somehow the backslash got eliminated altogether.

Upvotes: 3

Related Questions