使用PHP读取.properties文件 [英] Read .properties files using PHP

查看:334
本文介绍了使用PHP读取.properties文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
PHP是否像Java一样允许* .properties文件?

Possible Duplicate:
Does PHP allow *.properties file as in Java?

如何使用PHP读取/解析.properties文件?

How to read/parse .properties file using PHP?

推荐答案

.properties文件通常在Java平台中使用. PHP中与之对应的是.ini文件. PHP可以使用 parse_ini_file() 来本地解析.ini文件.请参阅以下stackoverflow问题: PHP是否允许像Java一样允许* .properties文件?.

.properties files are usually used in Java platform. Its counterpart in PHP is .ini files. .ini files can be parsed natively by PHP using parse_ini_file(). See this stackoverflow question: Does PHP allow *.properties file as in Java?.

不过,如果您想读取和解析.properties文件,则必须手动执行.在Google上进行的快速搜索将我带到以下结果:

Still, if you would like to read and parse .properties files, you have to do that manually. A quick search on Google take me to the following result:

  • reading java-style properties file in PHP - Github repository

希望这会有所帮助:)

这篇关于使用PHP读取.properties文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆