【问题标题】:php T_STRING errorphp T_STRING 错误
【发布时间】:2011-12-07 10:24:14
【问题描述】:

在 mantis 中配置自定义字段时,我收到此错误消息,任何想法

解析错误:语法错误,意外的 T_STRING 在 C:\wamp\www\MyProj\custom_strings_inc.php 在第 3 行

代码是

<?php
if( lang_get_current() == 'german' ) {
    $defect_impact = 'Defect Impact'; #// German translation of Defect Impact
    $defect_type =  'Defect Type'; #// German translation of Defect Type
    $phase_of_origin =  ’Phase Of Origin’; #// German translation of Phase Of Origin
}else{
# Default (use your preferred language as the default)
    $defect_impact = 'Defect Impact'; // German translation of Defect Impact
    $defect_type =  'Defect Type'; // German translation of Defect Type
    $phase_of_origin =  'Phase Of Origin'; // German translation of Phase Of Origin
}
?>

【问题讨论】:

  • 有什么理由同时使用单行注释(# 和 //)?
  • 谢谢你 nettogrof,现在只使用 //

标签: php mantis


【解决方案1】:

这一行有错误的引号:

$phase_of_origin =  ’Phase Of Origin’;

应该是:

$phase_of_origin =  'Phase Of Origin';

【讨论】:

  • 尽管错误行已更改,但我仍然无法纠正它,错误消息是“解析错误:语法错误,C:\wamp\www\XRINFX\custom_strings_inc.php 中的意外 T_STRING 在第 8 行" 第 6,7,8 行是 6 => }else{ 7=>$defect_impact = 'Defect Impact'; // Defect Impact 8 的英文翻译=>$defect_type = 'Defect Type'; //缺陷类型的英文翻译
  • 谢谢你们,问题解决了,你是对的...我重命名了项目文件夹(在 www 内)现在它已经启动并运行,唯一的问题是如果我使用文件夹的原始名称,再次显示错误,再次感谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-17
  • 2017-06-20
  • 2023-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多