Unserialize giving errors at offset in php

Serialization in PHP is as easy as using serialize function. But to use the serizalized one, we need unserialize(). When you use this if you get an annoying notice of error at offset or something do this

$unserialized_value=@unserialize($serialized_value);
if ($unserialized_value)
{
    //enjoy the unserialized value here.
}

Mind you it won’t be a road blocker after all it is just a notice – but.. just cleaner is better