Jump to content

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?
Link to comment
https://forums.phpfreaks.com/topic/11914-anyone-ever-used-parse_ini_file/
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.

Ken
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.