array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.session-encode.php', 1 => 'session_encode', ), 'up' => array ( 0 => 'ref.session.php', 1 => 'Session Functions', ), 'prev' => array ( 0 => 'function.session-destroy.php', 1 => 'session_destroy', ), 'next' => array ( 0 => 'function.session-gc.php', 1 => 'session_gc', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/session/functions/session-encode.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
session_encode — Encodes the current session data as a session encoded string
session_encode() returns a serialized string of the contents of the current session data stored in the $_SESSION superglobal.
By default, the serialization method used is internal to PHP, and is not the same as serialize(). The serialization method can be set using session.serialize_handler.
This function has no parameters.
Returns the contents of the current session encoded, or false
on failure.
Must call session_start() before using session_encode().