sadece okuma yapacaksanız şu sınıf işinizi görebilir
<?php
    class ini{

        public $file;

        private $settings,
        $content,
        $cleanedContent;

        public function ini($file= "ayarlar.ini")
        {
            $this->readFromFile( $file );
        }

        public function readFromFile( $file )
        {
            if( !is_file( $file ) )
                die("<b>".$file."</b> dosyası bulunamadı .");
            $this->readFromString( file_get_contents( $this->file = $file ));
            return $this;
        }

        public function get($setName)
        {
            if(isset($this->settings[$setName]))
                return $this->settings[$setName];
            else return null;
        }

        public function set($setName,$value)
        {
            $this->settings[$setName]=$value;
        }

        public function readFromString( $content )
        {
            $this->Parse( $this->content=$content );
            return $this;
        }

        private function Parse( $content )
        {
            $this->cleanedContent = preg_replace( '/^[\#;](.*)$/i','',$content );
            $this->cleanedContent = preg_replace( '/[\s]+\#.*$/im','',$this->cleanedContent);

            $lines = explode("\r\n",$this->cleanedContent);

            $isOpen=true;
            foreach( $lines as $line )
            {
                if(preg_match('/\{if(.*)\}/i',$line,$matches) && $isOpen)
                {
                    eval('$isOpen = '.stripslashes($matches[1]).';');
                }
                elseif(preg_match('/\{elseif(.*)\}/i',$line,$matches) && !$isOpen)
                {
                     eval('$isOpen = '.stripslashes($matches[1]).';');
                }
                elseif(preg_match('/\{else\}/i',$line,$matches))
                {
                    $isOpen = !$isOpen;
                }
                elseif(preg_match('/\{endif\}/i',$line,$matches))
                {
                      $isOpen = true;
                }
                elseif($isOpen)
                {
                    $key = trim(substr($line,0,$pos = strpos($line,'=')));
                    $value = $this->evulate(trim(substr($line,$pos+1,strlen($line))));
                    $this->settings[$key] = $value;
                }
            }
            return $this;

        }

        private function error($msg)
        {
             trigger_error($msg,E_USER_WARNING);
             return $msg;
        }

        private function evulate($exp)
        {
            if (preg_match('/\<eval\>(.*)\<\/eval\>/i',$exp,$match))
            eval('$exp='.$match[1].';');
            return $exp;

        }
    }
?>
Kullanımı
$Setting = new ini('ayarlar.ini');
echo $Setting->get("dbtype");