Home / PHP Tips Generated By ChatGPT / 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); }