Do this:
$sstr= base64_encode(serialize($foo));
$return= unserialize(base64_decode($sst));
Richard Kurth wrote:
This gets the same error
$testdata=stripslashes($testdata);
$testdata= unserialize($testdata);
var_dump($testdata);
And I can't stripslashes before serializing because I don't have control of
the script that sends the data
-----Original Message-----
From: Al [mailto:news@xxxxxxxxxxxxx]
Sent: Sunday, March 04, 2007 2:20 PM
To: php-general@xxxxxxxxxxxxx
Subject: Re: Getting bool(false) when using unserialize
stripslashes before serializing; not afterwards.
Richard Kurth wrote:
Way am I getting Error at offset 499 of 497 bytes bool(false) when I
run this script below according to the manual this should work';<?
$testdata="a:17:{s:11:\"event_start\";s:4:\"2230\";s:9:\"event_end\";s
:4:\"2
300\";s:14:\"start_unixtime\";i:1173076200;s:12:\"end_unixtime\";i:117
307800
0;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:\"CONTA
CT\";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(stripslashes($testdata));
var_dump($testdata);
?>
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php