Re: script stopped working- no output from unserialize()
| From: | Jochem Maas | Date: | Wed, 09 Aug 2006 20:17:59 +0000 |
| Subject: | Re: script stopped working- no output from unserialize() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240415@lists.php.net to get a copy of this message | ||
Ross wrote:
> So,
>
> When I echo out the results from the db I get the serialized data but when I
> try and pass the serialized data to the function to unserialize the output
> it doesn't work - no output what-so-ever. Also when the serialized data is
> sent to the function and then echoed out before it is unserialized() I get
> the expected result .- eg
> a:4:{i:0;s:4:"pass";i:1;s:4:"pass";i:2;s:4:"pass";
php -r 'echo serialize(array("pass","pass","pass"));'
a:4:{i:0;s:4:"pass";i:1;s:4:"pass";i:2;s:4:"pass";}
php -r
'var_dump(unserialize("a:4:{i:0;s:4:\"pass\";i:1;s:4:\"pass\";i:2;s:4:\"pass\";"));'
false
what does your serialized value NOT have that mine does?
>
> Which leads me to believe that the problem is with the php function
> unserialize().
looks to me like you are giving unserialize() a borked string and it's giving
you boolean false in return - that's a fair swap in my book.
>
> The same function works fine locally. I am working with php version 5
> locally and version 4.4.2 on the remote host Could that be the problem?
you can rule it out until you can rule it out.
>
>
> R.
>