我想在 Rediska 中创建一个 List 的新实例,但它似乎总是想使用一些全局列表。
例如,这是我用来创建新列表的代码:
$firstList = new Rediska_Key_List('newList');
$firstList[] = "firstList: first element";
$firstList[] = "firstList: second element";
$secondList = new Rediska_Key_List('newList');
$secondList[] = "secondList: first element";
$secondList[] = "secondList: second element";
echo "$secondList[0] and $secondList[1]";
它将回显以下内容:firstList:第一个元素和 firstList:第二个元素
据推测,这是因为 Rediska_Key_List 的第一个参数是同名的。我不需要这个。我只想创建一个新的无名实例。我不能将第一个参数留空。我希望脚本打印以下内容:
`secondList: first element and secondList: second element`
谢谢!
最佳答案
如果还不想存到redis中,只需要建一个php表,需要的时候再拷贝到redis中
关于php - 如何使用 Rediska 创建列表的新实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6527615/