Skip to content

Instantly share code, notes, and snippets.

@kejyun
Created December 8, 2013 06:11
Show Gist options
  • Save kejyun/7853907 to your computer and use it in GitHub Desktop.
Save kejyun/7853907 to your computer and use it in GitHub Desktop.
php與node.js共享memcache資料
// 使用php-memcached套件
var Memcached = require('php-memcached');
var memcached = new Memcached('127.0.0.1:11211');
// 讀取Memcached資料
memcached.get('php_memcached_key', function (err, data) {
var data_from_php = JSON.parse(data);
console.log(data_from_php);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment