PHP Classes

parse_ini_file

Recommend this page to a friend!

      INI File Parser  >  All threads  >  parse_ini_file  >  (Un) Subscribe thread alerts  
Subject:parse_ini_file
Summary:Function parse_ini_file
Messages:2
Author:Jonathan
Date:2008-05-30 09:30:29
Update:2008-05-30 22:21:23
 

  1. parse_ini_file   Reply   Report abuse  
Picture of Jonathan Jonathan - 2008-05-30 09:30:30
Hello Roy,

Why have you created a class to parse ini file ?

There's already a php function : parse_ini_file()

It would be great if we could manage an INI file.

Best regards,
Jonathan

  2. Re: parse_ini_file   Reply   Report abuse  
Picture of Roy Cunningham Roy Cunningham - 2008-05-30 22:21:23 - In reply to message 1 from Jonathan
Hi Jonathan,

I wrote this originally long ago (I just turned it into a class for posting purposes) because the built-in function didn't handle my case (this may have been a misunderstanding on my part I suppose). Anyway, I had 2 requirements that I didn't meet with it - the first is that I needed to open the ini file from a web server, the second is that I needed to parse the sections separately as some of the keys existed in more than 1 section. I haven't looked at parse_ini_file since...

In case you're wondering - I used the http method to retrieve the ini file so that a partner of mine could control the php script options without needing access to the php server or needing any php knowledge at all. He just hosts the ini file and makes the necessary changes on the fly. It worked quite well actually.

Roy