php8.5
Home/ Manual/ yaf / yaf_config_ini/ Yaf_Config_Ini::rewind

Yaf_Config_Ini::rewind

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Reset iterator to first entry

Description

Yaf_Config_Ini::rewind(): void

Rewinds the internal iterator to the first configuration entry.

Parameters Parameters

Return Values

No value is returned.

Examples

Yaf_Config_Ini::rewind example

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

$config->next();
echo $config->key(), "\n";

$config->rewind();
echo $config->key(), "\n";
?>

The above example will output something similar to:

output
version
application

See Also

  • Yaf_Config_Ini::current
  • Yaf_Config_Ini::key
  • Yaf_Config_Ini::next
  • Yaf_Config_Ini::valid

Source: reference/yaf/yaf_config_ini/rewind.xml · from the official PHP manual (php/doc-en)