You are here

public static function PhpSerialize::encode in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Serialization/PhpSerialize.php \Drupal\Component\Serialization\PhpSerialize::encode()

Encodes data into the serialization format.

Parameters

mixed $data: The data to encode.

Return value

string The encoded data.

Throws

\Drupal\Component\Serialization\Exception\InvalidDataTypeException

Overrides SerializationInterface::encode

File

core/lib/Drupal/Component/Serialization/PhpSerialize.php, line 13

Class

PhpSerialize
Default serialization for serialized PHP.

Namespace

Drupal\Component\Serialization

Code

public static function encode($data) {
  return serialize($data);
}