Yaf_Config_Simple::key
PHP Manual
PHP Manual»Yaf_Config_Simple»Yaf_Config_Simple::key

Yaf_Config_Simple::key

(Yaf >=1.0.0)

Yaf_Config_Simple::key — Get current entry key

Descrizione

public function Yaf_Config_Simple::key(): mixed

Returns the key of the current configuration entry during iteration.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

The key of the current entry (string or integer), or false if the position is invalid.

Esempi

Example #1 Yaf_Config_Simple::key() example

<?php
$config = new Yaf_Config_Simple([
    'application' => ['name' => 'MyApp'],
    'database'    => ['host' => 'localhost'],
]);

for ($config->rewind(); $config->valid(); $config->next()) {
    echo $config->key(), "\n";
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

application
database

Vedere anche:

To Top