【发布时间】:2019-07-04 06:13:42
【问题描述】:
我一直在尝试调查错误,但似乎无法解决它。有人能帮忙吗。谢谢。
警告:语法错误,D:\langEn.ini 中第 4 行中的意外 '(' D:\Xampp\htdocs\PhpProject1\companyinfo.php 第 12 行
class CompanyInfo
{
function parse_files()
{
//files created for localization
$file1 = "D:\langEn.ini";
$file2 = "D:\jap.ini";
if($file1 == TRUE)
{
print_r(parse_ini_file($file1));
}
else
{
print_r(parse_ini_file($file2));
}
}
}
$obj = new CompanyInfo;
$obj ->parse_files();
输出:
Company Name:
Unikaihatsu Software Private Limited
HO Address(Mumbai):
33-34, Udyog Bhavan, Sonawala Lane,
Goregaon (East), Mumbai, India, PIN 400-063
Phone:+91-22-26867334 Fax:+91-22-26867334
URL: http://www.usindia.com
Branch Office(Ahemdabad):
Unitech Systems
A/410, Mardia Plaza, Near G. L. S. College,
C. G. Road, Ahmedabad, India, PIN 380-006
Phone:+91-79-26461287 Fax:+91-79-40327081
URL: http://www.usindia.com
Branch Office(Indore):
1st Floor, MPSEDC-STP Building,
Electronics Complex,
Pardeshipura, Indore, India, PIN 452010
Phone : +91-731-4075738 Fax : +91-731-4075738
URL : http://www.usindia.com
【问题讨论】:
-
你能显示
D:\langEn.ini文件的内容吗? -
公司名称:Unikaihatsu Software Private Limited HO 地址(孟买):33-34, Udyog Bhavan, Sonawala Lane, Goregaon (East), Mumbai, India, PIN 400-063 电话:+91-22 -26867334 传真:+91-22-26867334 URL: usindia.com Branch Office(Ahemdabad): Unitech Systems A/410, Mardia Plaza, Near G. L. S. College, C. G. Road, Ahmedabad, India, PIN 380-006 电话:+91- 79-26461287 传真:+91-79-40327081 网址:usindia.com
-
这是我在文件中的内容
-
使用“编辑”按钮将 ini 文件的内容添加到您的问题中并正确格式化,以便我们可以看到不同的行等。在 cmets 中很难正确读取它。谢谢
-
谢谢@ADyson。从现在开始,我一定会牢记这一点。