Re: configuration files
| From: | John Holmes | Date: | Thu, 11 Nov 2004 18:20:24 +0000 |
| Subject: | Re: configuration files | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37237@lists.php.net to get a copy of this message | ||
Malcolm JC Clark wrote:
I thought it would be a good idea to use parse_ini_file instead of doing require_once("config.ini"). However, what do I do about arrays that i had in my config file, cos parse_ini_file() does not like them. eg: [foods] favFoods = array('this','that','other',) I notice my php.ini file is arranged in a similar format, and where there are multiple options they are separated by a colon, like include_dir = ./:../ or something similar.You can use parse_ini_file and then just explode() the ones that you need to make into an array based upon whatever separator you used. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com