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 Link to comment https://forums.phpfreaks.com/topic/62525-config-file-read-and-write/ 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 Link to comment https://forums.phpfreaks.com/topic/62525-config-file-read-and-write/#findComment-311225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.