<?php
$index = 4;
$id = dba_open("frenzy.db", "w", "flatfile");
if(!$id) exit ("Some error...");
if(dba_exists($index, $id)) exit ("This key is using");
dba_close($id);
?>PHP - Manual: dba_exists
2025-10-31
(PHP 4, PHP 5, PHP 7, PHP 8)
dba_exists — 检查键是否存在
| 版本 | 说明 | 
|---|---|
| 8.4.0 | dba参数现在接受 Dba\Connection 实例,
  之前接受有效的dbaresource。 | 
<?php
$index = 4;
$id = dba_open("frenzy.db", "w", "flatfile");
if(!$id) exit ("Some error...");
if(dba_exists($index, $id)) exit ("This key is using");
dba_close($id);
?>