Posts Tagged ‘serialize’

PHP unserialize(): Error at offset – Error Solution

June 2, 2011 1 comment

Some time when we unserialize a variable in PHP, an error come out like

unserialize(): Error at offset

The reason of this error is corruption in “, ‘, :, & ; characters.

Quick Solution

the solution is 2 step based.

  1. While serializing the variable encode it with base64 encoding.


  2. While unserializing the variable decode the serialized variable using base64 encoding.