Unserialize返回false

I am serializing data stored in a database:

a:10:{s:4:"name";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:8:"keywords";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:11:"description";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:3:"sku";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:12:"manufacturer";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:11:"programname";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:12:"dataprovider";a:2:{s:4:"type";s:8:"excluded";s:5:"value";s:0:"";}s:11:"lastupdated";a:1:{s:5:"value";N;}s:8:"currency";a:1:{s:5:"value";s:0:"";}s:5:"price";a:1:{s:5:"value";s:3:"100";}}

When I unserialize, it returns empty data but when I echo the data and copy the o/p from the browser and put it statically for unserialize, it works fine.

Can anybody tell me what may be the issue?

What you have supplied above does and should work.

When saving serialized data in a database, set the length of the column to a very high amount.

If you think the serialized data will be no more than 1000 characters then add half onto it and you should be fine.

You would want to use VARCHAR(1500) for serializable data that you think will be around 1000 characters long.

I can almost guarantee that your problem is because the database is storing your serialized data and clipping it so that it can fit into your column.