tbobker Posted April 16, 2012 Share Posted April 16, 2012 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 More sharing options...
batwimp Posted April 16, 2012 Share Posted April 16, 2012 Could you go ahead and mark it solved? Link to comment https://forums.phpfreaks.com/topic/261063-parse_ini_file-error/#findComment-1337945 Share on other sites More sharing options...
salathe Posted April 16, 2012 Share Posted April 16, 2012 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. Link to comment https://forums.phpfreaks.com/topic/261063-parse_ini_file-error/#findComment-1337948 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.