maybe_unserialize( string $original )

Unserialize value only if it was serialized.

Description Description

Parameters Parameters


(string) (Required) Maybe unserialized original, if is needed.

Top ↑

Return Return

(mixed) Unserialized data can be any type.

Top ↑

Source Source

File: wp-includes/functions.php

function maybe_unserialize( $original ) {
	if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
		return @unserialize( $original );
	return $original;

Top ↑

Changelog Changelog

Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.