Jump to content

parse_ini_file() error


tbobker

Recommended Posts

UPDATE: Typical, as soon as a posted this message I solved it. For some reason php doesnt like my on=1. I changed this to status=on and all is good.

 

 

 

I have a ini file called settings.ini it contains the following:

 

[system]
on=1

 

The idea is that I update this ini file to turn the application on or off, 1 being on.

 

When I use parse_ini_file("settings.ini") I receive this error

Warning: Error parsing settings.ini on line 2 in

 

The PHP calling this is:

 

$ini = parse_ini_file("settings.ini");

 

What is wrong with this and is using a ini file the way to go. I thought its a bit much having it in a database its just a flag to tell the application if the system can run or not.

 

Any help appreciated.

I just cant see what the issue is.

Link to comment
https://forums.phpfreaks.com/topic/261063-parse_ini_file-error/
Share on other sites

Just for clarification, here is a note from the parse_ini_file() manual page:

 

Note: There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, false, on, off, none. Values null, no and false results in "", yes and true results in "1". Characters ?{}|&~![()^" must not be used anywhere in the key and have a special meaning in the value.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.