chdb::__construct
chdb 関数
chdb
PHP Manual

# chdb::get

(PECL chdb >= 0.1.0)

chdb::get — Gets the value associated with a key

### 説明

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

Gets the value associated with a key from a chdb database.

### パラメータ

`key`

  The key for which to get the value.

### 返り値

Returns a string containing the value associated with the given `key`, or `NULL` if not found.

### 例

例1 chdb::get() example

`<?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 $value1, PHP_EOL;
echo $value2, PHP_EOL;
?>`

上の例の出力は、 たとえば以下のようになります。

    value1
    value2

chdb::__construct
chdb 関数
chdb
PHP Manual