By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

How to check weather a variable contains serialized data or not

P: n/a

Hi,

Is there a way to check weather a variable contains serialized
data or not, as we hve some functions like
( is_ double,is_ float) to check the integer and float value.
Moses

Apr 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rik
mo************@gmail.com wrote:
Hi,

Is there a way to check weather a variable contains serialized
data or not, as we hve some functions like
( is_ double,is_ float) to check the integer and float value.
Very messy, but I have to admit I've used it:

function is_serialized($var){
$check = @unserialize($var);
return ($check===false && $var != serialize(false)) ? false : true;
}

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Apr 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.