wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



maybe_unserialize › WordPress Function

Od2.0.0
Przestarzałyn/a
maybe_unserialize ( $data )
Parametry:
  • (string) $data Data that might be unserialized.
    Wymagane: Tak
Powrót:
  • (mixed) Unserialized data can be any type.
Zdefiniowane na:
Codex:

Unserializes data only if it was serialized.



Źródło

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