Yaf_Config_Ini::key

Get current entry key

Description

public mixed Yaf_Config_Ini::key()

Returns the key of the current configuration entry during iteration.

Parameters

This function has no parameters.

Return Values

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

Examples

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

The above example will output something similar to:

application
version

See Also

  • Yaf_Config_Ini::current
  • Yaf_Config_Ini::next
  • Yaf_Config_Ini::rewind
  • Yaf_Config_Ini::valid