Skip to content

Instantly share code, notes, and snippets.

@volkan
Created January 7, 2013 20:51
Show Gist options
  • Select an option

  • Save volkan/4478272 to your computer and use it in GitHub Desktop.

Select an option

Save volkan/4478272 to your computer and use it in GitHub Desktop.

Revisions

  1. volkan created this gist Jan 7, 2013.
    20 changes: 20 additions & 0 deletions memcachedGet.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <?php

    $mc = new Memcached();

    $mc->setOption(
    Memcached::OPT_DISTRIBUTION,
    Memcached::DISTRIBUTION_CONSISTENT
    );

    $mc->addServers(array(
    array('localhost', 11211),
    array('localhost', 11212),
    array('localhost', 11213),
    array('localhost', 11214)
    ));

    for($i=0;$i<=10;$i++){
    var_dump($mc->get('key_' . $i));
    echo "<\br>";
    }