
SwooleTable::current는 현재 테이블의 행을 반환합니다.
#hostingforum.kr
php
$table = new SwooleTable(10, 2);
$table->column(0, ['name' => 'id', 'type' => SwooleTable::TYPE_INT]);
$table->column(1, ['name' => 'name', 'type' => SwooleTable::TYPE_STRING, 'len' => 50]);
$table->set('1', ['id' => 1, 'name' => 'John']);
$currentRow = $table->current();
echo $currentRow['id']; // 1
echo $currentRow['name']; // John
SwooleTable::current는 현재 테이블의 행을 반환하기 때문에, 테이블의 행을 수정하거나 삭제할 때 사용할 수 있습니다.
#hostingforum.kr
php
$table->current()->update(['name' => 'Jane']);
echo $table->current()['name']; // Jane
2025-07-14 16:39