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_Ini::__constructYaf_Config_Ini::current>
^Yaf_Config_IniLast updated: Mon, 26 Oct 2026

Yaf_Config_Ini::count

(Yaf >=1.0.0)

Yaf_Config_Ini::count — Count configuration entries

Description

public function Yaf_Config_Ini::count(): int

Returns the number of top-level configuration entries.

Parameters

This function has no parameters.

Return Values

The number of top-level entries as an integer.

Examples

Example #1 Yaf_Config_Ini::count() example

<?php
/**
 * Assume /etc/myapp/application.ini contains:
 * [common]
 * application.name = "MyApp"
 * database.host    = "localhost"
 * database.port    = 3306
 */
$config = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');

// Only the top-level entries ("application" and "database") are counted
var_dump(count($config));
var_dump($config->count());
?>

The above example will output something similar to:

int(2)
int(2)

See Also


<Yaf_Config_Ini::__constructYaf_Config_Ini::current>
^Yaf_Config_IniLast updated: Mon, 26 Oct 2026