RE: configuration files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yeah, maybe i need to reorganise my code a little. Thanks.

-----Original Message-----
From: John Holmes [mailto:holmes072000@xxxxxxxxxxx]
Sent: 11 November 2004 18:20
To: malcolm@xxxxxxxxxxxxx
Cc: php-db@xxxxxxxxxxxxx
Subject: Re:  configuration files


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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux