Yaf_Config_Simple::toArray
PHP Manual
PHP Manual»Yaf_Config_Simple»Yaf_Config_Simple::toArray

Yaf_Config_Simple::toArray

(Yaf >=1.0.0)

Yaf_Config_Simple::toArray — Export configuration as array

Beschreibung

public function Yaf_Config_Simple::toArray(): array

Returns the entire configuration as a plain PHP array.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

The configuration data as an array.

Beispiele

Beispiel #1 Yaf_Config_Simple::toArray() example

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

print_r($config->toArray());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [application] => Array
        (
            [name] => MyApp
        )

    [database] => Array
        (
            [host] => localhost
            [port] => 3306
        )

)

Siehe auch

To Top