您可以将PHP数组存储在Memcache中吗?

您可以将PHP数组存储在Memcache中吗?

问题描述:

您可以在Memcache中存储阵列吗?

我想存储;

  1. 用户ID号
  2. 用户的照片网址
  3. 用户名

一起作为一个数组,有人告诉我你可以,然后有人告诉我你不能 是哪一个?

Together as an array, someone told me you could and then someone told me you couldn't Which is it?

是.

Memcache::set('someKey', array(
    'user_id' => 1,
    'url' => 'http://',
    'name' => 'Dave'
));

有关非常详细的示例,请参阅文档.

Please see the documentation for very detailed examples.