PHP 8.6.0 Beta 3 is available for testing

Yaf_Config_Ini::valid

(Yaf >=1.0.0)

Yaf_Config_Ini::validCheck if current position is valid

Beschreibung

public function Yaf_Config_Ini::valid(): bool

Checks whether the current iterator position is valid.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

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

Beispiele

Beispiel #1 Yaf_Config_Ini::valid() 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');

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

$config->next();
var_dump($config->valid());

$config->next(); // past the last entry
var_dump($config->valid());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(true)
bool(false)

Siehe auch

add a note

User Contributed Notes

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