×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Peter Wendel
Added: Apr 18, 2015 9:56 PM
Views: 18
Tags: config file ini php
Reads $section of an .ini-File and returns it.
  1. public function readConfigFile($section=INIT_FIRST_CONFIG_SECTION){
  2.         $path = $this->getIniFilePath().$this->getIniFileName().$this->getIniFileExtension();
  3.         if(is_file($path) && is_readable($path)){
  4.             $tempArray = parse_ini_file($path,true);
  5.         } else{
  6.             //ERRORHANDLING
  7.             print "ERROR[Config_Reader_001]: Config_File kann nicht gefunden werden oder die Rechte sind falsch gesetzt.";
  8.         }        
  9.         return $tempArray[$section];
  10.     }