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



maybe_unserialize › WordPress Function

Since2.0.0
已弃用n/a
› maybe_unserialize ( $data )
参数:
  • (string) $data Data that might be unserialized.
    Required: Yes
返回:
  • (mixed) Unserialized data can be any type.
定义在:
文档:

Unserializes data only if it was serialized.



源码

function maybe_unserialize( $data ) {
	if ( is_serialized( $data ) ) { // Don't attempt to unserialize data that wasn't serialized going in.
		return @unserialize( trim( $data ) );
	}

	return $data;
}