Checking if a String is Serialized in PHP


Determine if a given string is serialized data with a custom function.

Source Code

function is_serialized($str) {
    return ($str == serialize(false) || @unserialize($str) !== false);
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments