Re: [PHP] parsing ini files

2003-10-15 Thread John W. Holmes
Andrei Popovici wrote: I have a script which reads his configuration from an ini file. For reading that file I use the parse_ini function. When the ini is written incorectly the php displays a message that he has encountered a parse error in that ini. How can I catch that error and display a messa

RE: [PHP] parsing ini files

2003-10-15 Thread Jay Blanchard
[snip] Correct. The error I'm getting it's because the ini file is not properly formed. But I want to catch somehow this error and tell the user that he made a mistake in the ini file. I'm not edititng that file programmatically, I just want the user who made that mistake to see a more frendly erro

RE: [PHP] parsing ini files

2003-10-15 Thread Jay Blanchard
[snip] I have a script which reads his configuration from an ini file. For reading that file I use the parse_ini function. When the ini is written incorectly the php displays a message that he has encountered a parse error in that ini. How can I catch that error and display a message of my own? [/s

Re: [PHP] parsing ini files

2003-01-28 Thread 1LT John W. Holmes
> I have a file which contains the following syntax: > > ; Events listings > [event] > month = january > day = 23 > year = 2003 > venue = some club > description = this is an event > > [event] > month = january > day = 12 > year = 2003 > venue = another club > description = this is another event >

Re: [PHP] parsing ini files

2003-01-28 Thread Chris Hayes
I have a file which contains the following syntax: ; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event [event] month = january day = 12 interesting function, i had not seen it yet. You could have a look at the alternative function m

Re: [PHP] parsing ini files

2003-01-28 Thread Maxim Maletsky
there is a bunch of examples to parse the ini files in PHP. You can even do one on your own: 1. loop every line 2. if format is [**] then this is the key 3. everything till the empty line is a key = value pair P.S: please, when replying click on "new email" and cut&paste the email address. If you