thiggins09 Posted August 14, 2007 Share Posted August 14, 2007 Hi, I have since fixed my last problem with the communities help but now have a new one. I have a serialized array which has somehow become corrupt. Is there anything that can attempt to correct it? Link to comment https://forums.phpfreaks.com/topic/64932-damaged-serialized-array/ Share on other sites More sharing options...
hostfreak Posted August 14, 2007 Share Posted August 14, 2007 Can you post the code in which you serialize and unserialize it? edit- you don't have access to the original value before it was serialized? Link to comment https://forums.phpfreaks.com/topic/64932-damaged-serialized-array/#findComment-324026 Share on other sites More sharing options...
thiggins09 Posted August 14, 2007 Author Share Posted August 14, 2007 No sorry I don't. It's only stored as a serialized array. Here is how I open and serialize / unserialize the array. $xFile='x/list.php'; if($xPath=fopen($xFile,'r')) { $xContent=unserialize(fread($xPath,filesize($xFile))); fclose($xPath); } and serializing / writing. if($xPath=fopen($xFile,'w')) { fwrite($xPath,serialize($xContent)); fclose($xPath); } Link to comment https://forums.phpfreaks.com/topic/64932-damaged-serialized-array/#findComment-324037 Share on other sites More sharing options...
thiggins09 Posted August 14, 2007 Author Share Posted August 14, 2007 I see now that I should have another if for unserializing and serializing... but what should I do about my corrupt serialized array? Link to comment https://forums.phpfreaks.com/topic/64932-damaged-serialized-array/#findComment-324057 Share on other sites More sharing options...
thiggins09 Posted August 15, 2007 Author Share Posted August 15, 2007 Anyone know a way to save the data? I would manually rewrite it but its about 400 multidimensional keys. Link to comment https://forums.phpfreaks.com/topic/64932-damaged-serialized-array/#findComment-324303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.