#在内存中建立一张表,用来存放进程交互过程中使用的数据,与memocache似有异曲同工之妙
#用法
<?php
$table = new swoole_table(2048);
$table->column("id",$table::TYPE_INT,4); #为内存表添加列
$table->column("name",$table::TYPE_STRING,32);
$table->column("age",$table::TYPE_INT,4);
$table->create(); #创建内存表
$table->set("cpc",["id"=>1,"name"=>"陈培昌","age"=>22]);
$table->set("cj",["id"=>2,"name"=>"程劲","age"=>16]);
$table->decr("cpc","age",1); #增加某一列的值
$table->incr("cj","age",2); #扣减某一列的值
if ($table->exist("cpc")) #判断键名是否存在
{
print_r($table["cpc"]);
}
if ($table->exist("cj"))
{
print_r($table->get("cj"));
}
?>