Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Config_Simple::setYaf_Config_Simple::valid>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026

Yaf_Config_Simple::toArray

(Yaf >=1.0.0)

Yaf_Config_Simple::toArray — Export configuration as array

Description

public function Yaf_Config_Simple::toArray(): array

Returns the entire configuration as a plain PHP array.

Parameters

This function has no parameters.

Return Values

The configuration data as an array.

Examples

Example #1 Yaf_Config_Simple::toArray() example

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

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

The above example will output something similar to:

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

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

)

See Also


<Yaf_Config_Simple::setYaf_Config_Simple::valid>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026