<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.memcache.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'memcache.replace.php',
    1 => 'Memcache::replace',
    2 => 'Replace value of the existing item',
  ),
  'up' => 
  array (
    0 => 'class.memcache.php',
    1 => 'Memcache',
  ),
  'prev' => 
  array (
    0 => 'memcache.pconnect.php',
    1 => 'Memcache::pconnect',
  ),
  'next' => 
  array (
    0 => 'memcache.set.php',
    1 => 'Memcache::set',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/memcache/memcache/replace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="memcache.replace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcache::replace</h1>
  <h1 class="refname">memcache_replace</h1>
  <p class="verinfo">(PECL memcache &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">Memcache::replace</span> -- <span class="refname">memcache_replace</span> &mdash; <span class="dc-title">Replace value of the existing item</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcache.replace-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>Memcache::replace</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$var</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flag</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$expire</code><span class="initializer"> = ?</span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>memcache_replace</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.memcache.php" class="type Memcache">Memcache</a></span> <code class="parameter">$memcache</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$var</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flag</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$expire</code><span class="initializer"> = ?</span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>


  <p class="simpara">
   <span class="function"><strong>Memcache::replace()</strong></span> should be used to replace value of
   existing item with <code class="parameter">key</code>. In case if item with such
   key doesn&#039;t exists, <span class="function"><strong>Memcache::replace()</strong></span> returns
   <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. For the rest <span class="function"><strong>Memcache::replace()</strong></span> behaves
   similarly to <span class="function"><a href="memcache.set.php" class="function">Memcache::set()</a></span>.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-memcache.replace-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <span class="simpara">
      The key that will be associated with the item.
     </span>
    </dd>
   
   
    <dt><code class="parameter">var</code></dt>
    <dd>
     <span class="simpara">
      The variable to store. Strings and integers are stored as is, other
      types are stored serialized.
     </span>
    </dd>
   
   
    <dt><code class="parameter">flag</code></dt>
    <dd>
     <span class="simpara">
      Use <strong><code><a href="memcache.constants.php#constant.memcache-compressed">MEMCACHE_COMPRESSED</a></code></strong> to store the item
      compressed (uses zlib).
     </span>
    </dd>
   
   
    <dt><code class="parameter">expire</code></dt>
    <dd>
     <span class="simpara">
      Expiration time of the item. If it&#039;s equal to zero, the item will never
      expire. You can also use Unix timestamp or a number of seconds starting
      from current time, but in the latter case the number of seconds may not
      exceed 2592000 (30 days).
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcache.replace-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
   Başarı durumunda <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-memcache.replace-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 <span class="function"><strong>Memcache::replace()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$memcache_obj </span><span style="color: #007700">= </span><span style="color: #0000BB">memcache_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* procedural API */<br /></span><span style="color: #0000BB">memcache_replace</span><span style="color: #007700">(</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">, </span><span style="color: #DD0000">"test_key"</span><span style="color: #007700">, </span><span style="color: #DD0000">"some variable"</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* OO API */<br /></span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">replace</span><span style="color: #007700">(</span><span style="color: #DD0000">"test_key"</span><span style="color: #007700">, </span><span style="color: #DD0000">"some variable"</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcache.replace-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="memcache.set.php" class="function" rel="rdfs-seeAlso">Memcache::set()</a> - Store data at the server</span></li>
   <li><span class="function"><a href="memcache.add.php" class="function" rel="rdfs-seeAlso">Memcache::add()</a> - Add an item to the server</span></li>
  </ul>
 </div>


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