<?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 4, PHP 5, PHP 7, PHP 8)
dba_exists — キーが存在するかどうかを確認する
   dba_exists() は、指定した key
   がデータベースに存在するかどうかを確認します。
  
| バージョン | 説明 | 
|---|---|
| 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);
?>