PHP Velho Oeste 2024

chdb::get

(PECL chdb >= 0.1.0)

chdb::get获取与键相关联的值

说明

public chdb::get ( string $key ) : string

从 chdb 数据库中获取与键相关联的值。

参数

key

要获取值的键。

返回值

返回 key 对应的值,如果找不到则返回 NULL

范例

Example #1 chdb::get() 示例:

<?php

$data 
= array(
    
'key1' => 'value1',
    
'key2' => 'value2',
    
// ...
);
chdb_create('data.chdb'$data);

$chdb = new chdb('data.chdb');
$value1 $chdb->get('key1');
$value2 $chdb->get('key2');

echo 
$value1PHP_EOL;
echo 
$value2PHP_EOL;

?>

以上例程的输出类似于:

value1
value2
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top