Full-Demon Posted July 30, 2007 Share Posted July 30, 2007 Hi, Does anyone know a function, class or library to easy edit configuration file? Like the XML functions but than for configuration files. Or should I write my own class for this? FD Quote Link to comment Share on other sites More sharing options...
Barand Posted July 30, 2007 Share Posted July 30, 2007 If you have an ini file format, eg [section1] param1=abc param2=def [section2] color=#C0FFEE bgd=#000000 Then $config = parse_ini_file('config.txt', true); --> array ( 'section1' = array ( 'param1' = 'abc', 'param2' = 'def' ), 'section2' = array ( 'color' = '#C0FFEE', 'bgd' = '#000000' ) So echo $config['section2']['bgd'] --> #000000 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.