Yaf_Session::rewind
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Reset session iterator to first entry
Description
Yaf_Session::rewind(): void
Rewinds the internal iterator to the first session entry.
Parameters Parameters
Return Values
No value is returned.
Examples
Yaf_Session::rewind example
php
<?php
$session = Yaf_Session::getInstance();
$session->start();
$session->set("user_id", 42);
$session->set("lang", "en");
foreach ($session as $key => $value) {
echo "$key => $value", PHP_EOL;
}
// a new foreach implicitly calls rewind() again
foreach ($session as $key => $value) {
echo "$key => $value", PHP_EOL;
}
?>The above example will output something similar to:
output
user_id => 42
lang => en
user_id => 42
lang => enSee Also
Yaf_Session::currentYaf_Session::keyYaf_Session::nextYaf_Session::valid