📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  ezutils / ini_read  

<< Introduction to INI files  Debugging >> 

Reading from INI files

To read from an INI file, you must create an eZINI instance for the given file. You can check whether a variable exists before you read it, but this is optional.

include_once( "lib/ezutils/classes/ezini.php" );

// Creates an eZINI instance for settings/site.ini
$ini =& eZINI::instance( "site.ini", "settings" );

// Reads the value of the key SiteName in the group SiteSettings, if it exists
if ( $ini->hasVariable( "SiteSettings", "SiteName" ) )
    $var = $ini->variable( "SiteSettings", "SiteName" );

// Reads all key/value pairs of the SiteSettings group, it it exists
if ( $ini->hasGroup( "SiteSettings" ) )
    $vars = $ini->group( "SiteSettings" );

Exponential Copyright © 1998 - 2026 7x