PHP: Memcache::replace - Manual in Deutsh
PHP: Memcache::replace - Manual in French
PHP: Memcache::replace - Manual in Polish

You Are At PHP: Memcache::replace - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

Memcache::replace

(no version information, might be only in CVS)

Memcache::replace -- Replace value of the existing item

Description

bool Memcache::replace ( string key, mixed var [, int flag [, int expire]] )

Memcache::replace() should be used to replace value of existing item with key. In case if item with such key doesn't exists, Memcache::replace() returns FALSE. For the rest Memcache::replace() behaves similarly to Memcache::set(). Also you can use memcache_replace() function.

Parameters

key

The key that will be associated with the item.

var

The variable to store. Strings and integers are stored as is, other types are stored serialized.

flag

Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib).

expire

Expiration time of the item. If it'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).

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example 1. Memcache::replace() example

<?php

$memcache_obj
= memcache_connect('memcache_host', 11211);

/* procedural API */
memcache_replace($memcache_obj, "test_key", "some variable", false, 30);

/* OO API */
$memcache_obj->replace("test_key", "some variable", false, 30);

?>

See Also

Memcache::set()
Memcache::add()

Numizmatyka
Agencja Reklamowa Katowice
analizy
banki kredyty
salon

Another Useful functions:


ref.memcache | function.memcache-setserverparams | function.memcache-setcompressthreshold | function.memcache-set | function.memcache-replace | function.memcache-pconnect | function.memcache-increment | function.memcache-getversion | function.memcache-getstats | function.memcache-getserverstatus | function.memcache-getextendedstats | function.memcache-get | function.memcache-flush | function.memcache-delete | function.memcache-decrement | function.memcache-debug | function.memcache-connect | function.memcache-close | function.memcache-addserver | function.memcache-add |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.