Jump to content


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


Anyone ever used parse_ini_file()??

Recommended Posts

If I have a bunch of INI files that have all sorts of information in them that I need to read and write into a database, is there an easy way to get those into a database safely??? Let me elaborate: For characters like, $,[,],{,},!,(,), parse_ini_file()/PHP are reporting a "parsing error" on the lines where it encounters one of the previously described characters. Does anyone have an easy way that I can get PHP to read those characters without having to change around the script that generated the original INI file?

Share this post

Link to post
Share on other sites
Did you see the following note in the [a href=\"http://www.php.net/parse_ini_file\" target=\"_blank\"]fine manual[/a]?
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--][b]Note:[/b] There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, and false. 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.[/quote]

Also read the comments posted there, you might find something that works for your situation.


Share this post

Link to post
Share on other sites


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.