php8.5
Home/ Manual/ yaf / yaf_config_simple/ Yaf_Config_Simple::rewind

Yaf_Config_Simple::rewind

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Reset iterator to first entry

Description

Yaf_Config_Simple::rewind(): void

Rewinds the internal iterator to the first configuration entry.

Parameters Parameters

Return Values

No value is returned.

Examples

Yaf_Config_Simple::rewind example

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

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

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

The above example will output something similar to:

output
database
application

See Also

  • Yaf_Config_Simple::current
  • Yaf_Config_Simple::key
  • Yaf_Config_Simple::next
  • Yaf_Config_Simple::valid

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