PHP Classes

File: example/indexMemcache.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Simple Cache Library   example/indexMemcache.php   Download  
File: example/indexMemcache.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Simple Cache Library
Access data in different types of cache containers
Author: By
Last change:
Date: 5 years ago
Size: 800 bytes


Class file image Download

//load the class file
require_once 'init.php';
/* Memcache usage */

$mcache = new Lablnet\mcache('localhost', 11111);

$mcache->store('name', 'Malik Umer Farooq', 0);
$mcache->store('age', '17', 0);
$mcache->store('email', '', 0);
$mcache->update('email', '');

$mcache->replace('email', '', 0);

$delete = $mcache->delete('email');

//get once record

//get multiple records
echo '<br>';
var_dump($mcache->getMultiple(['name', 'age']));

//delete master its delete all data

//add new server
$mcache->addServer('localhost', 22222);

$version = $mcache->version();

//finally close the server connection