Basic usage

Example #1 memcache extension overview example

In this example, an object is being saved in the cache and then
retrieved back. Object and other non-scalar types are serialized
before saving, so it's impossible to store resources (i.e. connection
identifiers and others) in the cache.

<?php

$memcache = new Memcache;$memcache->connect('localhost', 11211) or die ("Could not connect");