bool addServer* *( string $host [, int $port = 11211 [, bool $persistent [, int $weight [, int $timeout [, int $retry_interval [, bool$status [, callback $failure_callback [, int $timeoutms ]]]]]]]] )
bool connect* *( string $host [, int $port [, int $timeout ]] )
bool flush* *( void )
bool* *pconnect ( string $host [, int $port [, int $timeout ]] )
bool setServerParams* *( string $host [, int $port = 11211 [, int $timeout [, int $retry_interval = false [, bool $status [, callback$failure_callback ]]]]] )
$mem = new Memcache;
$mem->init();
$mem->set('key6', 'hello', 0, 120);
$val = $mem->get('key6');
echo "Get key6 value:".$val."
";
$mem->add('key7', 'welcome you', 0, 120);
$val = $mem->get('key7');
echo "Get add key7 value:".$var."
";
$mem->set('key7', 'welcome', 0, 120);
$val = $mem->get('key7');
echo "Get key7 value:".$val."
";
$mem->set('key8', 'thanks', 0, 120);
$val = $mem->get('key8');
echo "Get key8 value:".$val."
";
$mem->replace('key8', 'thank you', false, 120);
$val = $mem->get('key8');
echo "Get replace key8 value:".$val."
";
$mem->delete('key6');
$val = $mem->get('key6');
echo "Get key6 value after delete:".$val."
";
$mem->close();
?>