public static function maybeUnSerialize($original)
    {
        if (! is_string($original) || trim($original) == '') {
            return $original;
        }

        /**
         * Check if serialized
         * check with trim
         */
        if (self::isSerialized($original)) {
            /**
             * use trim if possible
             * Serialized value could not start & end with white space
             */
            return @unserialize(trim($original));
        }

        return $original;
    }
public static function maybeUnSerialize($original)
    {
        if (! is_string($original) || trim($original) == '') {
            return $original;
        }

        /**
         * Check if serialized
         * check with trim
         */
        if (self::isSerialized($original)) {
            /**
             * use trim if possible
             * Serialized value could not start & end with white space
             */
            return @unserialize(trim($original));
        }

        return $original;
    }
public static function maybeUnSerialize ( $ original ) { if ( ! is_string ( $ original ) || trim ( $ original ) == '' ) { return $ original ; } /**
         * Check if serialized
         * check with trim
         */ if ( self :: isSerialized ( $ original ) ) { /**
             * use trim if possible
             * Serialized value could not start & end with white space
             */ return @ unserialize ( trim ( $ original ) ) ; } return $ original ; }
Un-serialize value only if it was serialized.

@param  string $original Maybe un-serialized original, if is needed.
@return mixed  Un-serialized data can be any type.
Un - serialize value only if it was serialized .