WordPress开发者和主题制作者的搜索引擎



maybe_unserialize ›

Since2.0.0
已弃用n/a
maybe_unserialize ( $original )
参数:
  • (string) $original Maybe unserialized original, if is needed.
    Required: Yes
返回:
  • (mixed) Unserialized data can be any type.
定义在:
文档:

Unserialize value only if it was serialized.



源码

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;
}