Re: Turning serialize data into an array

From: Date: Tue, 06 Mar 2007 14:30:47 +0000
Subject: Re: Turning serialize data into an array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249928@lists.php.net to get a copy of this message
btw, the code: $testdata='a:17:{s:11:"event_start";s:4:"2230";s:9:"event_end";s:4:"2300";s:14:"start_unixtime";i:1173076200;s:12:"end_unixtime";i:1173078000;s:10:"event_text";s:37:"Call+NANCYADKINS+-+%28276%29+681-6548";s:12:"event_length";i:1800;s:13:"event_overlap";i:0;s:11:"description";s:17:"This+is+test+Data";s:6:"status";s:0:"";s:5:"class";s:7:"CONTACT";s:9:"spans_day";b:0;s:8:"location";s:0:"";s:9:"organizer";s:6:"a:0:{}";s:8:"attendee";s:6:"a:0:{}";s:9:"calnumber";i:1;s:7:"calname";s:5:"admin";s:3:"url";s:0:""}}'; $testdata = unserialize($testdata); print_r($testdata); ""Richard Kurth"" <richardkurth@centurytel.net> wrote in message news:014901c75f75$af9ec9e0$6402a8c0@RLaptop... > How can I get the data out of this string that has been serialize I need > to > get it into an array so I can access the data with something like > $testdata[1] > I have tried > $testdata= unserialize($testdata); > also > $sst= base64_encode(serialize($testdata)); > $testdata1= unserialize(base64_decode($sst)); > > I ether get an error bool(false) or the same data back. > I do not have control of the script that serializes it > > > $testdata='a:17:{s:11:"event_start";s:4:"2230";s:9:"event_end";s:4:"2300";s: > > 14:"start_unixtime";i:1173076200;s:12:"end_unixtime";i:1173078000;s:10:"even > > t_text";s:37:"Call+NANCYADKINS+-+%28276%29+681-6548";s:12:"event_length";i:1 > > 800;s:13:"event_overlap";i:0;s:11:"description";s:17:"This+is+test+Data";s:6 > > :"status";s:0:"";s:5:"class";s:7:"CONTACT";s:9:"spans_day";b:0;s:8:"location > > ";s:0:"";s:9:"organizer";s:6:"a:0:{}";s:8:"attendee";s:6:"a:0:{}";s:9:"calnu > > mber";i:1;s:7:"calname";s:5:"admin";s:3:"url";s:0:""'; > > >

« previous php.general (#249928) next »