是否可以使用 PHP 对 .ini 文件使用内联注释?
通过 PHP 对 .ini 文件使用内联注释是否可能且安全?
我更喜欢这样的系统:注释与变量内联,位于变量之后。
是否存在一些与要使用的语法有关的问题?
Is it possible and safe to use inline comments for .ini files with PHP?
I prefer a system where the comments are inline with the variables, coming after them.
Are the some gotchas concerning the syntax to be used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
INI 格式 使用分号作为注释字符。它接受文件中的任何位置。
INI format uses semicolon as a comment character. It accepts them anywhere in the file.
如果您正在谈论内置的 INI 文件解析功能,分号是它期望的注释字符,我相信它内联接受它们。
If you're talking about the built-in INI file parsing function, semicolon is the comment character it expects, and I believe it accepts them inline.
输出:
请注意,PHP 的 INI 解析器不支持
#
注释。Outputs:
Note that PHP's INI parser does not support
#
for comments.