<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.session.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.session-encode.php',
    1 => 'session_encode',
    2 => '現在のセッションデータを、セッションエンコードされた文字列に変換する',
  ),
  'up' => 
  array (
    0 => 'ref.session.php',
    1 => 'セッション関数',
  ),
  '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' => 'ja',
    'path' => 'reference/session/functions/session-encode.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.session-encode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_encode</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">session_encode</span> &mdash; <span class="dc-title">現在のセッションデータを、セッションエンコードされた文字列に変換する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.session-encode-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>session_encode</strong></span>(): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>session_encode()</strong></span> は、
   現在のセッションの内容をシリアライズした文字列を返します．
   現在のセッションの内容は、スーパーグローバル $_SESSION から取得します。
  </p>
  <p class="para">
   デフォルトのアンシリアライズの方法は PHP が内部的に実装しているものであり、
   <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span> とは違います。
   シリアライズの方法は、<a href="session.configuration.php#ini.session.serialize-handler" class="link">session.serialize_handler</a>
   で設定できます。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.session-encode-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">この関数にはパラメータはありません。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-encode-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   現在のセッションの内容をエンコードしたものを返します。
   失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.session-encode-notes">
  <h3 class="title">注意</h3>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="para">
    <span class="function"><strong>session_encode()</strong></span> を使う前には <span class="function"><a href="function.session-start.php" class="function">session_start()</a></span> を呼ぶ必要があります。
   </p>
  </div>
 </div>
 
 
 <div class="refsect1 seealso" id="refsect1-function.session-encode-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.session-decode.php" class="function" rel="rdfs-seeAlso">session_decode()</a> - セッションエンコードされた文字列からセッションデータをデコードする</span></li>
    <li><a href="session.configuration.php#ini.session.serialize-handler" class="link">session.serialize_handler</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>