Yaf_Session::valid

(Yaf >=1.0.0)

Yaf_Session::validCheck if current session position is valid

Açıklama

public function Yaf_Session::valid(): bool

Checks whether the current session iterator position is valid.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns true if the current position is valid, false otherwise.

Örnekler

Örnek 1 Yaf_Session::valid() example

<?php
$session = Yaf_Session::getInstance();
$session->start();

$session->set("user_id", 42);

$session->rewind();
var_dump($session->valid());

$session->next();
// past the last entry, the position is no longer valid
var_dump($session->valid());
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

bool(true)
bool(false)

Ayrıca Bakınız

add a note

User Contributed Notes

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