【发布时间】:2013-02-13 22:17:58
【问题描述】:
好吧,我已经阅读了一段时间,到目前为止我发现的最佳解决方案是:How to read and write to an ini file with PHP
我已经安装了 pear 包。包含启动课程所需的文件。如图所示: https://github.com/pear/Config_Lite/blob/master/docs/examples
但是我在获取变量时遇到了麻烦。
这是我的ini文件:
[Account]
acct1.UserName = something1
acct1.Password = something2
acct1.Signature = something3
acct1.AppId = something4
# Subject is optional and is required only in case of third party authorization
acct1.Subject =
这是我迄今为止尝试过的:
$config = new Config_Lite('$filename');
echo $config->get('Account', 'acct1.UserName');
它不起作用并返回错误。
提前致谢。
【问题讨论】:
-
您不应该收到无效文件名的错误吗?
-
马里奥感谢你让我大开眼界。文件名被引用了 bah