PHP 8.6.0 Beta 3 is available for testing

Yaf_Config_Simple::key

(Yaf >=1.0.0)

Yaf_Config_Simple::keyGet current entry key

Beschreibung

public function Yaf_Config_Simple::key(): mixed

Returns the key of the current configuration entry during iteration.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

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

Beispiele

Beispiel #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";
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

application
database

Siehe auch

add a note

User Contributed Notes

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