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
[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
[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
> 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
>
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
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
6 matches
Mail list logo