PHP 8.6.0 Beta 3 is available for testing

Yaf_Config_Abstract::toArray

(Yaf >=1.0.0)

Yaf_Config_Abstract::toArrayExport configuration as array

Beschreibung

public function Yaf_Config_Abstract::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, or null if no configuration data is loaded.

Beispiele

Beispiel #1 Yaf_Config_Abstract::toArray() example

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

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

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

)

Siehe auch

add a note

User Contributed Notes

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