Jump to content


Anyone ever used parse_ini_file()??

  • Please log in to reply
1 reply to this topic

#1 thepip3r

  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 13 June 2006 - 08:19 PM

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?

#2 kenrbnsn

  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 June 2006 - 09:04 PM

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--]Note: 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.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users