I have data stored in database tables as serialized.
One of my functions needs to return true if the value is serialized.
foreach($data as $r):
if($r->options is serialized) {
$unserialized_value = unserialize($r->options);
}
endforeach;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
there’s a couple of functions out there:
is_serialized
http://www.cs278.org/blog/2009/10/23/php-function-is_serialized/
couple more suggestions here:
Check to see if a string is serialized?