Forum PHP 2026 - Paris (France)

Yaf_Config_Ini::key

(Yaf >=1.0.0)

Yaf_Config_Ini::keyGet current entry key

Опис

public function Yaf_Config_Ini::key(): mixed

Returns the key of the current configuration entry during iteration.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

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

Приклади

Приклад #1 Yaf_Config_Ini::key() example

<?php
/**
 * Assume /etc/myapp/application.ini contains:
 * [common]
 * application.name = "MyApp"
 * version          = "1.0"
 */
$config = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');

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

Поданий вище приклад виведе щось схоже на:

application
version

Прогляньте також

add a note

User Contributed Notes

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