I figured out a little bit later. It's something like:

rawurlencdoe(serialize($attachments));
unserialize(urldecode(stripslashes($attachments)));

I overlook that rawurlencode/urldecode, another annoying thing :) I just
came from perl, for half time  I found PHP cute, another half time, you know
it already, annoying :)  Simple stuff sometimes not simple which as you know
also is in contract to perl. But I still like PHP, for half and half is
still very good percentage, if Steve Francis can shoot at this percentage
(like Yao Ming does), Rockets will be much better off, right?

Thanks anyway!

Guangzu


----- Original Message -----
From: "Guangzu Wang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 17, 2002 4:48 PM
Subject: [PHP] serialize/unserialize problem


> Hi,
> I am working on mime message and try to pass an array with serialize and
> unserialize and got some problems.
> Here's some code snippet:
>
> in my function, I have this:
>
> $message['attachments'] = serialize($attachments);
>
> And calling code like this:
>
> $attachments = $message['attachments'];
> echo "ATTACHMENT:$attachments<br>";
> $attachments = unserialize($attachments);
> echo "After unserialize:$attachments<br>";
>
> Here's the output:
>
>
>
ATTACHMENT:a:1:{i:0;a:6:{s:3:"pid";i:2;s:4:"type";s:10:"image/jpeg";s:8:"enc
>
oding";s:6:"base64";s:4:"size";s:5:"13540";s:11:"disposition";s:10:"attachme
> nt";s:4:"name";s:10:"Sample.jpg";}}
> After unserialize:
>
> It supposed to be an array after unserialize, but I got a empty result. I
> used is_array() and got a false. I looked the online manual and tried
those
> annoying addslashes/stripslashes, nothing changed. What am I missed?
>
> Thanks a lot for your help!
>
> Guangzu
> http://tjmu.com
> http://GuangzuWang.incredibuys.com/
>
>
> --
> 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

Reply via email to